-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello,
sorry for my former patch. This one was pretty useless. Now I had
found time to dig into the problems.

I've sent a pull request from me
https://github.com/wofwofwof/Launchy
to https://github.com/OpenNingia/Launchy

The pull request is visible here.
https://github.com/OpenNingia/Launchy/pull/7

Details of the fixes can be seen in the pull request.

The complete diff is attached.

- -- 
cheers

Wolfgang
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJWNl3cAAoJEG77w815zV8vEfoP/iuzNfe4wJlrj3s9t3FM9Ei/
8L+kcUJJUazrXURIWlmCz4AQxB8QeyD7zAp1mqKXfCdZERUkq87LDbRlovF4cbT0
NMm+FyETonjV9AniAsHfkYNKIeEff9KWCaHffOHQkcai0UF+49R75yBZL0UDqFDy
MCPuQRiTqX4wklxuVky/oSSaF8xsk7X3OX9yoe8rXXofqkIiRzIEnK4Tg5HaK0oJ
XMgx/VB9aVf8nHbp2TUquxYOw/yuxzpPN5/vD6CkEIifTvgnXfPSx463HD88V2rU
RPTIttLy6z8Xr6mrZdLqutltrpl3Jyq/2vJr7U6ftdAFWzq4XtLJwDn5FhcaoDfA
1ytwnEVe1CT06jDWLG8pIkLKrUbPqFVGMyuU+fHETW+5WazEsl05hObb0Qk+BR+y
5P6x1yhbt1BwrMs47WsMNYWwxzBiFshwXw9tav41B6BoZFRJ/SLW8SA1FBJc8VFX
Q+15IQH0nPrfu/OZDCiGOFmf0xXjHnKHSYxkWm+2wzpIZWQyulBfJp9UVE3ey80G
0rqXE3qZ62oGlRxpkZVADv4Mcox/aWUuFfFXW4HYs5kkbaczH7YSgBWmN9HFYi2Y
/FN54QsuL+diFAq8CBT8ERmwHj1dz3RStDF1Tf2g/T5uLpjH2yWPOgZYkif39l0c
Y0538tbt47X/mAxL9Vnw
=qdxI
-----END PGP SIGNATURE-----
diff --git a/trunk/Launchy_QT/platforms/unix/platform_unix.cpp 
b/trunk/Launchy_QT/platforms/unix/platform_unix.cpp
index 22ba256..a5394d2 100644
--- a/trunk/Launchy_QT/platforms/unix/platform_unix.cpp
+++ b/trunk/Launchy_QT/platforms/unix/platform_unix.cpp
@@ -160,16 +160,13 @@ void PlatformUnix::alterItem(CatItem* item) {
     while(!file.atEnd()) {
        QString line = QString::fromUtf8(file.readLine());
        
-       if (line.startsWith("Name[" + locale, Qt::CaseInsensitive)) 
+       if (name == "" && line.startsWith("Name[" + locale, 
Qt::CaseInsensitive))
            name = line.split("=")[1].trimmed();
-       
-
-       else if (line.startsWith("Name=", Qt::CaseInsensitive)) 
+       else if (name == "" && line.startsWith("Name=", Qt::CaseInsensitive))
            name = line.split("=")[1].trimmed();
-
-       else if (line.startsWith("Icon", Qt::CaseInsensitive))
+       else if (icon == "" && line.startsWith("Icon", Qt::CaseInsensitive))
            icon = line.split("=")[1].trimmed();
-       else if (line.startsWith("Exec", Qt::CaseInsensitive))
+       else if (exe == "" && line.startsWith("Exec", Qt::CaseInsensitive))
            exe = line.split("=")[1].trimmed(); 
     }
     if (name.size() >= item->shortName.size() - 8) {
@@ -219,12 +216,10 @@ void PlatformUnix::alterItem(CatItem* item) {
     
     item->fullPath = exe + " " + allExe.join(" ");
 
-    // Cache the icon for this desktop file
-    //shared_ptr<UnixIconProvider> 
u(dynamic_pointer_cast<UnixIconProvider>(icons));
-//    shared_ptr<UnixIconProvider> u((UnixIconProvider*) icons.get());
-    
-    //icon = u->getDesktopIcon(file.fileName(), icon);
-    icon = ((UnixIconProvider*)icons)->getDesktopIcon(file.fileName(), icon);
+    if (!QFile::exists(icon)) {
+        icon = ((UnixIconProvider*)icons)->getDesktopIcon(file.fileName(), 
icon);
+    }
+
 
     QFileInfo inf(icon);
     if (!inf.exists()) {
diff --git a/trunk/Launchy_QT/platforms/unix/platform_unix_util.cpp 
b/trunk/Launchy_QT/platforms/unix/platform_unix_util.cpp
index ab8d91f..ddee59a 100644
--- a/trunk/Launchy_QT/platforms/unix/platform_unix_util.cpp
+++ b/trunk/Launchy_QT/platforms/unix/platform_unix_util.cpp
@@ -14,7 +14,7 @@ UnixIconProvider::UnixIconProvider() {
        QStringList spl = line.split("=");
        xdgDataDirs = spl[1].split(":");        
     }
-    xdgDataDirs += "/usr/share/icons/";
+    xdgDataDirs += "/usr/share";
 }
 
 
@@ -138,8 +138,12 @@ QString UnixIconProvider::getDesktopIcon(QString 
desktopFile, QString IconName)
        themes += "/hicolor/32x32";
        themes += "/hicolor/48x48";
        themes += "/hicolor/64x64";
+        themes += "/hicolor/scalable";
         themes += "/oxygen/32x32";
         themes += "/gnome/32x32";
+        themes += "/gnome/scalable";
+        themes += "/";
+
 
        
        QStringList dirs;       
@@ -157,8 +161,7 @@ QString UnixIconProvider::getDesktopIcon(QString 
desktopFile, QString IconName)
        foreach(QString dir, dirs) {
            QDir d(dir);
            QStringList sdirs;
-           if (!dir.endsWith("pixmaps"))
-               sdirs = d.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
+            sdirs = d.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
            sdirs += "."; 
            
            foreach (QString subdir, sdirs) {

Attachment: diff.sig
Description: PGP signature

Reply via email to