From bb7ad945c1541684a02e853fdaabd0e3ba74f8df Mon Sep 17 00:00:00 2001 From: ulf69 Date: Fri, 02 Jul 2004 15:33:56 +0000 Subject: removed reentrant solution, for something better --- diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp index 6fa0dd6..2b1bd34 100644 --- a/microkde/kglobal.cpp +++ b/microkde/kglobal.cpp @@ -29,17 +29,7 @@ void KGlobal::setLocale(KLocale *kg) KConfig *KGlobal::config() { - static bool reentrant = false; - - if (reentrant) - return 0; - - if ( !mConfig ) { - reentrant = true; - mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) ); - reentrant = false; - } - + //mConfig is set inside setAppName. Though it has to be the first function you call. return mConfig; } @@ -95,6 +85,8 @@ KStandardDirs *KGlobal::dirs() void KGlobal::setAppName( const QString &appName ) { mAppName = appName; + + mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) ); } //US -- cgit v0.9.0.2