-rw-r--r-- | microkde/kglobal.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp index 6fa0dd6..2b1bd34 100644 --- a/microkde/kglobal.cpp +++ b/microkde/kglobal.cpp @@ -16,43 +16,33 @@ KLocale *KGlobal::locale() ASSERT(mAppName); mLocale = new KLocale();//mAppName); } return mLocale; } //US void KGlobal::setLocale(KLocale *kg) { mLocale = 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; } KGlobal::Size KGlobal::getDesktopSize() { #ifdef DESKTOP_VERSION return KGlobal::Desktop; #else if ( QApplication::desktop()->width() < 480 ) return KGlobal::Small; else return KGlobal::Medium; #endif } KGlobal::Orientation KGlobal::getOrientation() @@ -82,32 +72,34 @@ KIconLoader *KGlobal::iconLoader() return mIconLoader; } KStandardDirs *KGlobal::dirs() { if ( !mDirs ) { mDirs = new KStandardDirs(); } return mDirs; } void KGlobal::setAppName( const QString &appName ) { mAppName = appName; + + mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) ); } //US QString KGlobal::getAppName() { return mAppName; } QString KGlobal::formatMessage ( QString mess, int maxlen ) { //int maxlen = 80; int start = 0; int end = mess.length(); QString retVal = ""; int nl, space; while ( (end - start) > maxlen ) { nl = mess.find( "\n", start ); |