From 3f6f8c53969fe0b975273ac5d97dbc429a86acd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 6 Aug 2020 20:55:28 +0200 Subject: [PATCH] Fixed lack of new vm.icon property handling in Qube Manager --- qubesmanager/qube_manager.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qubesmanager/qube_manager.py b/qubesmanager/qube_manager.py index a6e5c47..6323757 100644 --- a/qubesmanager/qube_manager.py +++ b/qubesmanager/qube_manager.py @@ -202,6 +202,8 @@ class VmInfo(): self.label = getattr(self.vm, 'label', None) self.klass = getattr(self.vm, 'klass', None) + self.icon = getattr(vm, 'icon', 'appvm-black') + self.state = {'power': "", 'outdated': ""} self.updateable = getattr(vm, 'updateable', False) self.update(True) @@ -430,13 +432,11 @@ class QubesTableModel(QAbstractTableModel): if col_name == "Label": try: - return self.label_pixmap[vm.label] - except KeyError: - icon = QIcon.fromTheme(vm.label.icon) - self.label_pixmap[vm.label] = icon.pixmap(icon_size) - return self.label_pixmap[vm.label] - except exc.QubesDaemonAccessError: - return None + return self.label_pixmap[vm.icon] + except (KeyError, AttributeError): + icon = QIcon.fromTheme(vm.icon) + self.label_pixmap[vm.icon] = icon.pixmap(icon_size) + return self.label_pixmap[vm.icon] if role == Qt.FontRole: if col_name == "Template":