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

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/kernel
From:       Stephan Kulow <coolo () kde ! org>
Date:       2007-05-30 6:15:15
Message-ID: 1180505715.523322.10431.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 669715 by coolo:

mean trick: kde_default will return just a macro now.
In case there is code that uses kde_default for accessing
any files instead of using addResourceType, the code will
be broken. 


 M  +1 -59     kstandarddirs.cpp  
 M  +2 -2      kstandarddirs.h  


--- trunk/KDE/kdelibs/kdecore/kernel/kstandarddirs.cpp #669714:669715
@@ -1272,65 +1272,7 @@
 
 QString KStandardDirs::kde_default(const char *type) {
 
-    // The documentation for this method has all the information below.
-    // Make sure to update it if you update the code.
-
-    if (!strcmp(type, "data"))
-        return "share/apps/";
-    if (!strcmp(type, "html"))
-        return "share/doc/HTML/";
-    if (!strcmp(type, "icon"))
-        return "share/icons/";
-    if (!strcmp(type, "config"))
-        return "share/config/";
-    if (!strcmp(type, "pixmap"))
-        return "share/pixmaps/";
-    if (!strcmp(type, "apps"))
-        return "share/applnk/";
-    if (!strcmp(type, "sound"))
-        return "share/sounds/";
-    if (!strcmp(type, "locale"))
-        return "share/locale/";
-    if (!strcmp(type, "services"))
-        return "share/kde4/services/";
-    if (!strcmp(type, "servicetypes"))
-        return "share/kde4/servicetypes/";
-    if (!strcmp(type, "mime"))
-        return "share/mimelnk/";
-    if (!strcmp(type, "cgi"))
-        return "cgi-bin/";
-    if (!strcmp(type, "wallpaper"))
-        return "share/wallpapers/";
-    if (!strcmp(type, "templates"))
-        return "share/templates/";
-    if (!strcmp(type, "exe"))
-        return "bin/";
-    if (!strcmp(type, "lib"))
-        return "lib" KDELIBSUFF "/";
-    if (!strcmp(type, "module"))
-        return "lib" KDELIBSUFF "/kde4/";
-    if (!strcmp(type, "qtplugins"))
-        return "lib" KDELIBSUFF "/kde4/plugins";
-    if (!strcmp(type, "kcfg"))
-        return "share/config.kcfg";
-    if (!strcmp(type, "emoticons"))
-        return "share/emoticons";
-    if (!strcmp(type, "xdgdata-apps"))
-        return "applications/";
-    if (!strcmp(type, "xdgdata-icon"))
-        return "icons/";
-    if (!strcmp(type, "xdgdata-pixmap"))
-        return "pixmaps/";
-    if (!strcmp(type, "xdgdata-dirs"))
-        return "desktop-directories/";
-    if (!strcmp(type, "xdgdata-mime"))
-        return "mime/";
-    if (!strcmp(type, "xdgconf-menu"))
-        return "menus/";
-
-
-    qFatal("unknown resource type %s", type);
-    return QString();
+    return QString("%%1/").arg(type);
 }
 
 QString KStandardDirs::saveLocation(const char *type,
--- trunk/KDE/kdelibs/kdecore/kernel/kstandarddirs.h #669714:669715
@@ -225,7 +225,7 @@
      *
      * You may add as many as you need, but it is advised that there
      * is exactly one to make writing definite.
-     * All basic types (kde_default()) are added by addKDEDefaults(),
+     * All basic types are added by addKDEDefaults(),
      * but for those you can add more relative paths as well.
      *
      * The later a suffix is added, the higher its priority. Note, that the
@@ -250,7 +250,7 @@
      *
      * You may add as many as you need, but it is advised that there
      * is exactly one to make writing definite.
-     * All basic types (kde_default()) are added by addKDEDefaults(),
+     * All basic types are added by addKDEDefaults(),
      * but for those you can add more relative paths as well.
      *
      * The later a suffix is added, the higher its priority. Note, that the
[prev in list] [next in list] [prev in thread] [next in thread] 

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