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

List:       kde-core-devel
Subject:    Duplicate entries in ksycoca4
From:       Pascal =?iso-8859-1?q?L=E9tourneau?= <pascal.letourneau () gmail ! com>
Date:       2007-08-15 19:05:11
Message-ID: 200708151505.11294.pascal.letourneau () gmail ! com
[Download RAW message or body]

Hi

On my system, KStandardDirs::resourceDirs("applications") returns (among 
others)
/home/pletourn/kde/share/applications
	coming from "KDEDIR" + "share/" + "applications"
/home/pletourn/kde/share/applications/kde4
	coming from "XDG_APPS_INSTALL_DIR"
which cause duplicate apps entries in ksycoca4

With the included patch, installdir is no longer returned when it starts with 
one of the previous canditates

Is that an acceptable solution?

Pascal Létourneau

Index: kstandarddirs.cpp
===================================================================
--- kstandarddirs.cpp   (revision 700503)
+++ kstandarddirs.cpp   (working copy)
@@ -1117,8 +1117,17 @@ QStringList KStandardDirs::resourceDirs(

         // make sure we find the path where it's installed
         QString installdir = installPath( type );
-        if (!installdir.isEmpty() && !candidates.contains(installdir))
+        if (!installdir.isEmpty()) {
+            bool ok = true;
+            foreach (QString s, candidates) {
+                if (installdir.startsWith(s)) {
+                    ok = false;
+                    break;
+                }
+            }
+            if (ok)
             candidates.append(installdir);
+        }

         dirs = d->absolutes.value(type);
         if (!dirs.isEmpty())

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

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