[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE_3_2_BRANCH: kdelibs/kdecore
From:       Waldo Bastian <bastian () kde ! org>
Date:       2004-07-21 13:32:54
Message-ID: 20040721133254.883B899E4 () office ! kde ! org
[Download RAW message or body]

CVS commit by waba: 

KDesktopFile::locateLocal: Properly detect .directory files under
$KDEDIR/share/applnk when passed as absolute path. (BR85180)


  M +12 -4     kdesktopfile.cpp   1.44.2.1


--- kdelibs/kdecore/kdesktopfile.cpp  #1.44:1.44.2.1
@@ -60,7 +60,14 @@ QString KDesktopFile::locateLocal(const 
   if (path.endsWith(".directory"))
   {
-    if (!path.startsWith("/"))
+    local = path;
+    if (local.startsWith("/"))
     {
-      local = ::locateLocal("apps", path); // Relative to apps
+      // Relative wrt apps?
+      local = KGlobal::dirs()->relativeLocation("apps", path);
+    }
+
+    if (!local.startsWith("/"))
+    {
+      local = ::locateLocal("apps", local); // Relative to apps
     }
     else
@@ -68,7 +75,8 @@ QString KDesktopFile::locateLocal(const 
       // XDG Desktop menu items come with absolute paths, we need to 
       // extract their relative path and then build a local path.
-      local = KGlobal::dirs()->relativeLocation("xdgdata-dirs", path);
+      local = KGlobal::dirs()->relativeLocation("xdgdata-dirs", local);
       if (local.startsWith("/"))
       {
+        // Hm, that didn't work...
         // What now? Use filename only and hope for the best.
         local = path.mid(path.findRev('/')+1);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic