summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sessiontreemodel.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sessiontreemodel.cpp b/src/sessiontreemodel.cpp
index 6ebe11c..12eebf5 100644
--- a/src/sessiontreemodel.cpp
+++ b/src/sessiontreemodel.cpp
@@ -1,7 +1,10 @@
+#include "sessiontreemodel.h"
+
+#include <QFileInfo>
#include <QIcon>
+#include <QResource>
#include <QString>
-#include <QFileInfo>
-#include "sessiontreemodel.h"
+
#include "sessiontreeitem.h"
SessionTreeModel::SessionTreeModel(QObject *parent)
@@ -56,7 +59,13 @@ QVariant SessionTreeModel::data(const QModelIndex &index, int role) const {
return QIcon(icon);
} else {
// try to load icon from QResource
- return QIcon(":" + icon.toLower());
+ if (QResource(":" + icon.toLower() + ".svg").isValid()) {
+ return QIcon(":" + icon.toLower() + ".svg");
+ } else if (QResource(":" + icon.toLower()).isValid()) {
+ return QIcon(":" + icon.toLower());
+ } else {
+ return QIcon(":none");
+ }
}
}
}