Refactor properties that start with 'get' to avoid confusion between slots & properties

Case in point: LayerViewProxy.getLayerViewType was decorated as a property but was used/intended as a slot.
This commit is contained in:
fieldOfView 2017-02-17 13:35:01 +01:00
parent bb030c724b
commit 9229027001
8 changed files with 18 additions and 18 deletions

View file

@ -20,7 +20,7 @@ class LayerViewProxy(QObject):
preferencesChanged = pyqtSignal()
@pyqtProperty(bool, notify = activityChanged)
def getLayerActivity(self):
def layerActivity(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
return active_view.getActivity()
@ -79,7 +79,7 @@ class LayerViewProxy(QObject):
if type(active_view) == LayerView.LayerView.LayerView:
active_view.setLayerViewType(layer_view_type)
@pyqtProperty(bool)
@pyqtSlot(result = int)
def getLayerViewType(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
@ -124,7 +124,7 @@ class LayerViewProxy(QObject):
active_view.setShowInfill(show)
@pyqtProperty(int, notify = globalStackChanged)
def getExtruderCount(self):
def extruderCount(self):
active_view = self._controller.getActiveView()
if type(active_view) == LayerView.LayerView.LayerView:
return active_view.getExtruderCount()