c1349fe
diff -ur kdelibs-4.0.2/kdecore/config/kconfig.cpp kdelibs-4.0.2-no-cache-kdeglobals-paths/kdecore/config/kconfig.cpp
c1349fe
--- kdelibs-4.0.2/kdecore/config/kconfig.cpp	2008-01-05 01:00:39.000000000 +0100
c1349fe
+++ kdelibs-4.0.2-no-cache-kdeglobals-paths/kdecore/config/kconfig.cpp	2008-03-09 23:58:41.000000000 +0100
c1349fe
@@ -60,12 +60,6 @@
c1349fe
 {
c1349fe
     sGlobalFileName = componentData.dirs()->saveLocation("config") +
c1349fe
                           QString::fromLatin1("kdeglobals");
c1349fe
-    if (wantGlobals()) {
c1349fe
-        const KStandardDirs *const dirs = componentData.dirs();
c1349fe
-        foreach(const QString& dir, dirs->findAllResources("config", QLatin1String("kdeglobals")) +
c1349fe
-                                    dirs->findAllResources("config", QLatin1String("system.kdeglobals")))
c1349fe
-            globalFiles.push_front(dir);
c1349fe
-    }
c1349fe
     const QString etc_kderc =
c1349fe
 #ifdef Q_WS_WIN
c1349fe
         QFile::decodeName( QByteArray(::getenv("WINDIR")) + "\\kde4rc" );
c1349fe
@@ -75,15 +69,11 @@
c1349fe
     KEntryMap tmp;
c1349fe
     // first entry is always /etc/kderc or empty if cannot read
c1349fe
     if (KStandardDirs::checkAccess(etc_kderc, R_OK)) {
c1349fe
-        if (!globalFiles.contains(etc_kderc))
c1349fe
-            globalFiles.push_front(etc_kderc);
c1349fe
-
c1349fe
         if (!mappingsRegistered) {
c1349fe
             KSharedPtr<KConfigBackend> backend = KConfigBackend::create(componentData, etc_kderc, QLatin1String("INI"));
c1349fe
             backend->parseConfig( "en_US", tmp, KConfigBackend::ParseDefaults);
c1349fe
         }
c1349fe
     } else {
c1349fe
-        globalFiles.push_front(QString());
c1349fe
         mappingsRegistered = true;
c1349fe
     }
c1349fe
 
c1349fe
@@ -372,10 +362,31 @@
c1349fe
 
c1349fe
 void KConfigPrivate::parseGlobalFiles()
c1349fe
 {
c1349fe
+    QStringList globalFiles;
c1349fe
+
c1349fe
+    if (wantGlobals()) {
c1349fe
+        const KStandardDirs *const dirs = componentData.dirs();
c1349fe
+        foreach(const QString& dir, dirs->findAllResources("config", QLatin1String("kdeglobals")) +
c1349fe
+                                    dirs->findAllResources("config", QLatin1String("system.kdeglobals")))
c1349fe
+            globalFiles.push_front(dir);
c1349fe
+    }
c1349fe
+    const QString etc_kderc =
c1349fe
+#ifdef Q_WS_WIN
c1349fe
+        QFile::decodeName( QByteArray(::getenv("WINDIR")) + "\\kde4rc" );
c1349fe
+#else
c1349fe
+        QLatin1String("/etc/kde4rc");
c1349fe
+#endif
c1349fe
+    KEntryMap tmp;
c1349fe
+    // first entry is always /etc/kderc or empty if cannot read
c1349fe
+    if (KStandardDirs::checkAccess(etc_kderc, R_OK)) {
c1349fe
+        if (!globalFiles.contains(etc_kderc))
c1349fe
+            globalFiles.push_front(etc_kderc);
c1349fe
+    } else {
c1349fe
+        globalFiles.push_front(QString());
c1349fe
+    }
c1349fe
+
c1349fe
 //    qDebug() << "parsing global files" << globalFiles;
c1349fe
 
c1349fe
-    // TODO: can we cache the values in etc_kderc / other global files
c1349fe
-    //       on a per-application basis?
c1349fe
     const QByteArray utf8Locale = locale.toUtf8();
c1349fe
     foreach(const QString& file, globalFiles) {
c1349fe
         KConfigBackend::ParseOptions parseOpts = KConfigBackend::ParseGlobal|KConfigBackend::ParseExpansions;
c1349fe
diff -ur kdelibs-4.0.2/kdecore/config/kconfig_p.h kdelibs-4.0.2-no-cache-kdeglobals-paths/kdecore/config/kconfig_p.h
c1349fe
--- kdelibs-4.0.2/kdecore/config/kconfig_p.h	2008-01-05 01:00:39.000000000 +0100
c1349fe
+++ kdelibs-4.0.2-no-cache-kdeglobals-paths/kdecore/config/kconfig_p.h	2008-03-09 23:50:26.000000000 +0100
c1349fe
@@ -82,7 +82,6 @@
c1349fe
 
c1349fe
     KEntryMap entryMap;
c1349fe
     QString backendType;
c1349fe
-    QStringList globalFiles;
c1349fe
     QStack<QString> extraFiles;
c1349fe
 
c1349fe
     QString locale;