summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-01 01:38:10 (UTC)
committer ulf69 <ulf69>2004-07-01 01:38:10 (UTC)
commitd419ee83db7d2549c701fe89b678be619a7ce4d3 (patch) (unidiff)
tree2c6974dd047c51d7703d74f04217eafa6924b756
parente3e162fb75c497b95a9a9b43792fa88c998b265c (diff)
downloadkdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.zip
kdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.tar.gz
kdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.tar.bz2
adding reentrant flag, to avoid recursive call
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kglobal.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp
index 0aba952..6fa0dd6 100644
--- a/microkde/kglobal.cpp
+++ b/microkde/kglobal.cpp
@@ -1,13 +1,14 @@
1#include "kglobal.h" 1#include "kglobal.h"
2#include "kstandarddirs.h"
2#include <qkeycode.h> 3#include <qkeycode.h>
3#include <qapplication.h> 4#include <qapplication.h>
4 5
5KLocale *KGlobal::mLocale = 0; 6KLocale *KGlobal::mLocale = 0;
6KConfig *KGlobal::mConfig = 0; 7KConfig *KGlobal::mConfig = 0;
7KIconLoader *KGlobal::mIconLoader = 0; 8KIconLoader *KGlobal::mIconLoader = 0;
8KStandardDirs *KGlobal::mDirs = 0; 9KStandardDirs *KGlobal::mDirs = 0;
9 10
10QString KGlobal::mAppName = "godot"; 11QString KGlobal::mAppName = "godot";
11 12
12KLocale *KGlobal::locale() 13KLocale *KGlobal::locale()
13{ 14{
@@ -19,26 +20,33 @@ KLocale *KGlobal::locale()
19 20
20 return mLocale; 21 return mLocale;
21} 22}
22 23
23//US 24//US
24void KGlobal::setLocale(KLocale *kg) 25void KGlobal::setLocale(KLocale *kg)
25{ 26{
26 mLocale = kg; 27 mLocale = kg;
27} 28}
28 29
29KConfig *KGlobal::config() 30KConfig *KGlobal::config()
30{ 31{
32 static bool reentrant = false;
33
34 if (reentrant)
35 return 0;
36
31 if ( !mConfig ) { 37 if ( !mConfig ) {
32 mConfig = new KConfig( KStandardDirs::appDir() + mAppName + "rc" ); 38 reentrant = true;
39 mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) );
40 reentrant = false;
33 } 41 }
34 42
35 return mConfig; 43 return mConfig;
36} 44}
37 45
38KGlobal::Size KGlobal::getDesktopSize() 46KGlobal::Size KGlobal::getDesktopSize()
39{ 47{
40#ifdef DESKTOP_VERSION 48#ifdef DESKTOP_VERSION
41 return KGlobal::Desktop; 49 return KGlobal::Desktop;
42#else 50#else
43 if ( QApplication::desktop()->width() < 480 ) 51 if ( QApplication::desktop()->width() < 480 )
44 return KGlobal::Small; 52 return KGlobal::Small;