summaryrefslogtreecommitdiffabout
path: root/microkde/kglobal.cpp
authorulf69 <ulf69>2004-08-11 01:56:15 (UTC)
committer ulf69 <ulf69>2004-08-11 01:56:15 (UTC)
commit42860986468bb90c55783fcebc1b20bd3ee460ac (patch) (side-by-side diff)
tree35b2c491ae4fb98b018f72af29ee12ae67b5e053 /microkde/kglobal.cpp
parent1f7c51ec14521aedd2e8838f1760cdd5eb3ed08a (diff)
downloadkdepimpi-42860986468bb90c55783fcebc1b20bd3ee460ac.zip
kdepimpi-42860986468bb90c55783fcebc1b20bd3ee460ac.tar.gz
kdepimpi-42860986468bb90c55783fcebc1b20bd3ee460ac.tar.bz2
changed the Desktopsize to meaningfull values
Diffstat (limited to 'microkde/kglobal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kglobal.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp
index 2b1bd34..bf7e238 100644
--- a/microkde/kglobal.cpp
+++ b/microkde/kglobal.cpp
@@ -1,114 +1,116 @@
#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()
{
//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 )
+ if ( QApplication::desktop()->width() <= 320 )
return KGlobal::Small;
+ else if ( QApplication::desktop()->width() > 480)
+ return KGlobal::Desktop;
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 ) {
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 );
if ( nl > 0 && nl < start + maxlen ) {
nl += 1;
retVal += mess.mid( start, nl - start);
start = nl;
} else {
space = mess.findRev( " ", start + maxlen );
if ( space < start ) {
retVal += mess.mid( start, maxlen) +"\n";
start += maxlen ;