@@ -52,11 +52,42 @@ QUrl SessionsModel::iconUrl(const QString sessionName) const
5252 Q_FOREACH(const QUrl& searchDirectory, m_iconSearchDirectories)
5353 {
5454 // This is an established icon naming convention
55+ QString customIconUrl = searchDirectory.toString(QUrl::StripTrailingSlash) +
56+ "/custom_" + sessionName.toLower() + "_badge.png";
5557 QString iconUrl = searchDirectory.toString(QUrl::StripTrailingSlash) +
5658 "/" + sessionName.toLower() + "_badge.png";
59+
60+ QFile customIconFile(customIconUrl);
5761 QFile iconFile(iconUrl);
58− if (iconFile.exists()) {
62+ if (customIconFile.exists()) {
63+ return QUrl(customIconUrl);
64+ } else if (iconFile.exists()) {
5965 return QUrl(iconUrl);
66+ } else{
67+ // Search the legacy way
68+ QString path = searchDirectory.toString(QUrl::StripTrailingSlash) + "/";
69+ if (sessionName == "ubuntu" || sessionName == "ubuntu-2d") {
70+ path += "ubuntu_badge.png";
71+ } else if(
72+ sessionName == "gnome-classic" ||
73+ sessionName == "gnome-flashback-compiz" ||
74+ sessionName == "gnome-flashback-metacity" ||
75+ sessionName == "gnome-shell" ||
76+ sessionName == "gnome-wayland" ||
77+ sessionName == "gnome"
78+ ){
79+ path += "gnome_badge.png";
80+ } else if (sessionName == "plasma") {
81+ path += "kde_badge.png";
82+ } else if (sessionName == "xterm") {
83+ path += "recovery_console_badge.png";
84+ } else if (sessionName == "remote-login") {
85+ path += "remote_login_help.png";
86+ }
87+
88+ if (QFile(path).exists()) {
89+ return path;
90+ }
6091 }
6192 }
6293