From 0378531f13b989c6fe4bc22e2fbc14cce55c1dab Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 15 Oct 2021 16:24:43 +0200 Subject: [PATCH] Handle QML exposing of filterConnectionType if not filtering It should expose it as -1 then. Contributes to issue CURA-8609. --- cura/Machines/Models/GlobalStacksModel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cura/Machines/Models/GlobalStacksModel.py b/cura/Machines/Models/GlobalStacksModel.py index cfe8c7587a..586bd11819 100644 --- a/cura/Machines/Models/GlobalStacksModel.py +++ b/cura/Machines/Models/GlobalStacksModel.py @@ -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: