Handle QML exposing of filterConnectionType if not filtering

It should expose it as -1 then.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-15 16:24:43 +02:00
parent 0583814dfa
commit 0378531f13
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -61,7 +61,9 @@ class GlobalStacksModel(ListModel):
Only printers that match this connection type will be listed in the
model.
"""
return int(self._filter_connection_type)
if self._filter_connection_type is None:
return -1
return self._filter_connection_type.value
filterOnlineOnlyChanged = pyqtSignal()
def setFilterOnlineOnly(self, new_filter: bool) -> None: