summaryrefslogtreecommitdiffstats
path: root/src/sessionsiconholder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sessionsiconholder.cpp')
-rw-r--r--src/sessionsiconholder.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/sessionsiconholder.cpp b/src/sessionsiconholder.cpp
index 076abe8..7cce455 100644
--- a/src/sessionsiconholder.cpp
+++ b/src/sessionsiconholder.cpp
@@ -62,17 +62,16 @@ QIcon SessionsIconHolder::getIcon(const QString& name) {
if (icons.contains(name)) {
return icons[name];
}
+
// else load icon from resource
QIcon icon;
- icon = getIconFromResource(name);
- // if we didn't find any, check filesystem
- if (icon.isNull() && QFile::exists(name)) {
- icon = QIcon(name);
- }
- if (icon.isNull()) {
- // no cached icon, no icon in ressource, no icon in filesystem
- // fallback to linux icon if that works ;-)
- icon = getIconFromResource("linux");
+ QString resName(":" + name.toLower());
+ if (QResource(resName + ".svg").isValid()) {
+ icon = QIcon(resName + ".svg");
+ } else if (QResource(resName).isValid()) {
+ icon = QIcon(resName);
+ } else {
+ icon = QIcon();
}
// insert icon to hash table
@@ -107,16 +106,3 @@ QIcon SessionsIconHolder::getIcon(const QUrl& url) {
return QIcon();
}
-
-QIcon SessionsIconHolder::getIconFromResource(const QString& name) {
- QIcon icon;
- QString resName(":" + name.toLower());
- if (QResource(resName + ".svg").isValid()) {
- icon = QIcon(resName + ".svg");
- } else if (QResource(resName).isValid()) {
- icon = QIcon(resName);
- } else {
- icon = QIcon();
- }
- return icon;
-}