summaryrefslogtreecommitdiffabout
path: root/microkde
authorulf69 <ulf69>2004-07-01 01:38:10 (UTC)
committer ulf69 <ulf69>2004-07-01 01:38:10 (UTC)
commitd419ee83db7d2549c701fe89b678be619a7ce4d3 (patch) (side-by-side diff)
tree2c6974dd047c51d7703d74f04217eafa6924b756 /microkde
parente3e162fb75c497b95a9a9b43792fa88c998b265c (diff)
downloadkdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.zip
kdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.tar.gz
kdepimpi-d419ee83db7d2549c701fe89b678be619a7ce4d3.tar.bz2
adding reentrant flag, to avoid recursive call
Diffstat (limited to 'microkde') (more/less context) (show 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,80 +1,88 @@
#include "kglobal.h"
+#include "kstandarddirs.h"
#include <qkeycode.h>
#include <qapplication.h>
KLocale *KGlobal::mLocale = 0;
KConfig *KGlobal::mConfig = 0;
KIconLoader *KGlobal::mIconLoader = 0;
KStandardDirs *KGlobal::mDirs = 0;
QString KGlobal::mAppName = "godot";
KLocale *KGlobal::locale()
{
if ( !mLocale ) {
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 ) {
- mConfig = new KConfig( KStandardDirs::appDir() + mAppName + "rc" );
+ reentrant = true;
+ mConfig = new KConfig( locateLocal("config", mAppName + "rc" ) );
+ reentrant = false;
}
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()
{
if (QApplication::desktop()->width() > QApplication::desktop()->height())
return KGlobal::Landscape;
else
return KGlobal::Portrait;
}
int KGlobal::getDesktopWidth()
{
return QApplication::desktop()->width();
}
int KGlobal::getDesktopHeight()
{
return QApplication::desktop()->height();
}
KIconLoader *KGlobal::iconLoader()
{
if ( !mIconLoader ) {
mIconLoader = new KIconLoader();
}
return mIconLoader;
}
KStandardDirs *KGlobal::dirs()
{
if ( !mDirs ) {