055eeab
diff -Naur kdelibs-4.1.72/kdecore/config/kconfig.cpp kdelibs-4.1.72.no-cache-kdeglobals-path/kdecore/config/kconfig.cpp
055eeab
--- kdelibs-4.1.72/kdecore/config/kconfig.cpp	2008-10-23 01:05:09.000000000 +0200
055eeab
+++ kdelibs-4.1.72.no-cache-kdeglobals-path/kdecore/config/kconfig.cpp	2008-11-10 17:38:33.000000000 +0100
055eeab
@@ -61,12 +61,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
055eeab
         QFile::decodeName( qgetenv("WINDIR") + "/kde4rc" );
055eeab
@@ -76,15 +70,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
 
055eeab
@@ -461,10 +451,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;
055eeab
diff -Naur kdelibs-4.1.72/kdecore/config/kconfig_p.h kdelibs-4.1.72.no-cache-kdeglobals-path/kdecore/config/kconfig_p.h
055eeab
--- kdelibs-4.1.72/kdecore/config/kconfig_p.h	2008-06-03 11:34:54.000000000 +0200
055eeab
+++ kdelibs-4.1.72.no-cache-kdeglobals-path/kdecore/config/kconfig_p.h	2008-11-10 17:38:33.000000000 +0100
055eeab
@@ -86,7 +86,6 @@
c1349fe
 
c1349fe
     KEntryMap entryMap;
c1349fe
     QString backendType;
c1349fe
-    QStringList globalFiles;
c1349fe
     QStack<QString> extraFiles;
c1349fe
 
c1349fe
     QString locale;