aboutsummaryrefslogtreecommitdiffstats
path: root/python/extensionmanager/list.py
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-09-21 13:15:47 +0200
committerEike Ziller <eike.ziller@qt.io>2018-09-21 11:54:38 +0000
commit9ebe20ca27fbce2ca2934e40dfd1a7a21aaa6658 (patch)
tree03effab1e69b9213210ee63c7ad32c37418b42ab /python/extensionmanager/list.py
parent4d6487e753b8838f460769ff9758ac6c82a88a35 (diff)
Avoid scanning extension directory over and over again
And get rid of separate management of a list of loaded extensions. Instead save the name and state of an extension in a separate class. It will probably get more information about the extension, like its location. The extension manager UI now can also iterate over that list once. Change-Id: I4872e55d621837a7d476e69b919f06aeb491ff03 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'python/extensionmanager/list.py')
-rw-r--r--python/extensionmanager/list.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/extensionmanager/list.py b/python/extensionmanager/list.py
index d213c35..32002b1 100644
--- a/python/extensionmanager/list.py
+++ b/python/extensionmanager/list.py
@@ -58,11 +58,11 @@ class ExtensionList(QtWidgets.QListWidget):
i = 0
for ext in instance.extensionList():
item = QtWidgets.QListWidgetItem(self)
- if not ext in instance.extensionList(True):
- item.setText(ext + " [did not load]")
+ if not ext.loaded:
+ item.setText(ext.name + " [did not load]")
item.setIcon(QtGui.QIcon.fromTheme("dialog-error"))
else:
- item.setText(ext)
+ item.setText(ext.name)
item.setIcon(QtGui.QIcon.fromTheme("applications-development"))
if i % 2 == 1:
item.setBackground(QtGui.QBrush(QtGui.QColor.fromRgb(240, 240, 240)))