-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 | |||
@@ -26,23 +26,13 @@ void KGlobal::setLocale(KLocale *kg) | |||
26 | { | 26 | { |
27 | mLocale = kg; | 27 | mLocale = kg; |
28 | } | 28 | } |
29 | 29 | ||
30 | KConfig *KGlobal::config() | 30 | KConfig *KGlobal::config() |
31 | { | 31 | { |
32 | static bool reentrant = false; | 32 | //mConfig is set inside setAppName. Though it has to be the first function you call. |
33 | |||
34 | if (reentrant) | ||
35 | return 0; | ||
36 | |||
37 | if ( !mConfig ) { | ||
38 | reentrant = true; | ||
39 | mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) ); | ||
40 | reentrant = false; | ||
41 | } | ||
42 | |||
43 | return mConfig; | 33 | return mConfig; |
44 | } | 34 | } |
45 | 35 | ||
46 | KGlobal::Size KGlobal::getDesktopSize() | 36 | KGlobal::Size KGlobal::getDesktopSize() |
47 | { | 37 | { |
48 | #ifdef DESKTOP_VERSION | 38 | #ifdef DESKTOP_VERSION |
@@ -92,12 +82,14 @@ KStandardDirs *KGlobal::dirs() | |||
92 | return mDirs; | 82 | return mDirs; |
93 | } | 83 | } |
94 | 84 | ||
95 | void KGlobal::setAppName( const QString &appName ) | 85 | void KGlobal::setAppName( const QString &appName ) |
96 | { | 86 | { |
97 | mAppName = appName; | 87 | mAppName = appName; |
88 | |||
89 | mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) ); | ||
98 | } | 90 | } |
99 | 91 | ||
100 | //US | 92 | //US |
101 | QString KGlobal::getAppName() | 93 | QString KGlobal::getAppName() |
102 | { | 94 | { |
103 | return mAppName; | 95 | return mAppName; |