-rw-r--r-- | microkde/kglobal.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp index 53edd08..9cc5835 100644 --- a/microkde/kglobal.cpp +++ b/microkde/kglobal.cpp | |||
@@ -1,80 +1,81 @@ | |||
1 | #include "kglobal.h" | 1 | #include "kglobal.h" |
2 | #include "kstandarddirs.h" | 2 | #include "kstandarddirs.h" |
3 | #include <qkeycode.h> | 3 | #include <qnamespace.h> |
4 | #include <qapplication.h> | 4 | #include <qapplication.h> |
5 | #include <QDesktopWidget> | ||
5 | 6 | ||
6 | KLocale *KGlobal::mLocale = 0; | 7 | KLocale *KGlobal::mLocale = 0; |
7 | KConfig *KGlobal::mConfig = 0; | 8 | KConfig *KGlobal::mConfig = 0; |
8 | KIconLoader *KGlobal::mIconLoader = 0; | 9 | KIconLoader *KGlobal::mIconLoader = 0; |
9 | KStandardDirs *KGlobal::mDirs = 0; | 10 | KStandardDirs *KGlobal::mDirs = 0; |
10 | 11 | ||
11 | QString KGlobal::mAppName = "godot"; | 12 | QString KGlobal::mAppName = "godot"; |
12 | 13 | ||
13 | KLocale *KGlobal::locale() | 14 | KLocale *KGlobal::locale() |
14 | { | 15 | { |
15 | if ( !mLocale ) { | 16 | if ( !mLocale ) { |
16 | ASSERT(mAppName); | 17 | Q_ASSERT(!mAppName.isEmpty()); |
17 | 18 | ||
18 | mLocale = new KLocale();//mAppName); | 19 | mLocale = new KLocale();//mAppName); |
19 | } | 20 | } |
20 | 21 | ||
21 | return mLocale; | 22 | return mLocale; |
22 | } | 23 | } |
23 | 24 | ||
24 | //US | 25 | //US |
25 | void KGlobal::setLocale(KLocale *kg) | 26 | void KGlobal::setLocale(KLocale *kg) |
26 | { | 27 | { |
27 | mLocale = kg; | 28 | mLocale = kg; |
28 | } | 29 | } |
29 | 30 | ||
30 | KConfig *KGlobal::config() | 31 | KConfig *KGlobal::config() |
31 | { | 32 | { |
32 | //mConfig is set inside setAppName. Though it has to be the first function you call. | 33 | //mConfig is set inside setAppName. Though it has to be the first function you call. |
33 | return mConfig; | 34 | return mConfig; |
34 | } | 35 | } |
35 | 36 | ||
36 | KGlobal::Size KGlobal::getDesktopSize() | 37 | KGlobal::Size KGlobal::getDesktopSize() |
37 | { | 38 | { |
38 | #ifdef DESKTOP_VERSION | 39 | #ifdef DESKTOP_VERSION |
39 | return KGlobal::Desktop; | 40 | return KGlobal::Desktop; |
40 | #else | 41 | #else |
41 | if ( QApplication::desktop()->width() <= 320 ) | 42 | if ( QApplication::desktop()->width() <= 320 ) |
42 | return KGlobal::Small; | 43 | return KGlobal::Small; |
43 | else if ( QApplication::desktop()->width() > 480) | 44 | else if ( QApplication::desktop()->width() > 480) |
44 | return KGlobal::Desktop; | 45 | return KGlobal::Desktop; |
45 | else | 46 | else |
46 | return KGlobal::Medium; | 47 | return KGlobal::Medium; |
47 | #endif | 48 | #endif |
48 | } | 49 | } |
49 | 50 | ||
50 | KGlobal::Orientation KGlobal::getOrientation() | 51 | KGlobal::Orientation KGlobal::getOrientation() |
51 | { | 52 | { |
52 | if (QApplication::desktop()->width() > QApplication::desktop()->height()) | 53 | if (QApplication::desktop()->width() > QApplication::desktop()->height()) |
53 | return KGlobal::Landscape; | 54 | return KGlobal::Landscape; |
54 | else | 55 | else |
55 | return KGlobal::Portrait; | 56 | return KGlobal::Portrait; |
56 | } | 57 | } |
57 | 58 | ||
58 | int KGlobal::getDesktopWidth() | 59 | int KGlobal::getDesktopWidth() |
59 | { | 60 | { |
60 | return QApplication::desktop()->width(); | 61 | return QApplication::desktop()->width(); |
61 | } | 62 | } |
62 | 63 | ||
63 | int KGlobal::getDesktopHeight() | 64 | int KGlobal::getDesktopHeight() |
64 | { | 65 | { |
65 | return QApplication::desktop()->height(); | 66 | return QApplication::desktop()->height(); |
66 | } | 67 | } |
67 | 68 | ||
68 | 69 | ||
69 | KIconLoader *KGlobal::iconLoader() | 70 | KIconLoader *KGlobal::iconLoader() |
70 | { | 71 | { |
71 | if ( !mIconLoader ) { | 72 | if ( !mIconLoader ) { |
72 | mIconLoader = new KIconLoader(); | 73 | mIconLoader = new KIconLoader(); |
73 | } | 74 | } |
74 | 75 | ||
75 | return mIconLoader; | 76 | return mIconLoader; |
76 | } | 77 | } |
77 | 78 | ||
78 | KStandardDirs *KGlobal::dirs() | 79 | KStandardDirs *KGlobal::dirs() |
79 | { | 80 | { |
80 | if ( !mDirs ) { | 81 | if ( !mDirs ) { |