Diffstat (limited to 'libkdepim/kpimglobalprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 0fdc3e4..e8fd2d1 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -23,32 +23,33 @@ | |||
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <kglobal.h> | 31 | #include <kglobal.h> |
32 | #include <kconfig.h> | 32 | #include <kconfig.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | #include <kdebug.h> | 34 | #include <kdebug.h> |
35 | #include <kstaticdeleter.h> | 35 | #include <kstaticdeleter.h> |
36 | 36 | ||
37 | #include <qregexp.h> | 37 | #include <qregexp.h> |
38 | #include <qfile.h> | 38 | #include <qfile.h> |
39 | #include <stdlib.h> | ||
39 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
40 | #include <qapplication.h> | 41 | #include <qapplication.h> |
41 | #include "kpimglobalprefs.h" | 42 | #include "kpimglobalprefs.h" |
42 | 43 | ||
43 | KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; | 44 | KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; |
44 | static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; | 45 | static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; |
45 | 46 | ||
46 | 47 | ||
47 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | 48 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) |
48 | : KPrefs("microkdeglobalrc") | 49 | : KPrefs("microkdeglobalrc") |
49 | { | 50 | { |
50 | mLocaleDict = 0; | 51 | mLocaleDict = 0; |
51 | KPrefs::setCurrentGroup("Locale"); | 52 | KPrefs::setCurrentGroup("Locale"); |
52 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); | 53 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); |
53 | addItemInt("PreferredTime",&mPreferredTime,0); | 54 | addItemInt("PreferredTime",&mPreferredTime,0); |
54 | addItemInt("PreferredDate",&mPreferredDate,0); | 55 | addItemInt("PreferredDate",&mPreferredDate,0); |
@@ -98,35 +99,35 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | |||
98 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); | 99 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); |
99 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); | 100 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); |
100 | 101 | ||
101 | KPrefs::setCurrentGroup( "PhoneAccess" ); | 102 | KPrefs::setCurrentGroup( "PhoneAccess" ); |
102 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); | 103 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); |
103 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); | 104 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); |
104 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); | 105 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); |
105 | 106 | ||
106 | } | 107 | } |
107 | 108 | ||
108 | void KPimGlobalPrefs::setGlobalConfig() | 109 | void KPimGlobalPrefs::setGlobalConfig() |
109 | { | 110 | { |
110 | if ( mLocaleDict == 0 ) { | 111 | if ( mLocaleDict == 0 ) { |
111 | QString fileName ; | 112 | QString fileName ; |
112 | QString name = KGlobal::getAppName() +"/"; | 113 | QString name = KGlobal::getAppName() +"/"; |
113 | #ifndef DESKTOP_VERSION | 114 | #ifndef DESKTOP_VERSION |
114 | fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name | 115 | fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name; |
115 | #else | 116 | #else |
116 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; | 117 | fileName = qApp->applicationDirPath () + "/kdepim/"+ name; |
117 | #endif | 118 | #endif |
118 | mLocaleDict = 0; | 119 | mLocaleDict = 0; |
119 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { | 120 | if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { |
120 | 121 | ||
121 | if ( mPreferredLanguage == 1 ) | 122 | if ( mPreferredLanguage == 1 ) |
122 | fileName = fileName+"germantranslation.txt"; | 123 | fileName = fileName+"germantranslation.txt"; |
123 | else if ( mPreferredLanguage == 4 ) | 124 | else if ( mPreferredLanguage == 4 ) |
124 | fileName = fileName+"usertranslation.txt"; | 125 | fileName = fileName+"usertranslation.txt"; |
125 | else if ( mPreferredLanguage == 2 ) | 126 | else if ( mPreferredLanguage == 2 ) |
126 | fileName = fileName+"frenchtranslation.txt"; | 127 | fileName = fileName+"frenchtranslation.txt"; |
127 | else if ( mPreferredLanguage == 3 ) | 128 | else if ( mPreferredLanguage == 3 ) |
128 | fileName = fileName+"italiantranslation.txt"; | 129 | fileName = fileName+"italiantranslation.txt"; |
129 | QFile file( fileName ); | 130 | QFile file( fileName ); |
130 | if (file.open( IO_ReadOnly ) ) { | 131 | if (file.open( IO_ReadOnly ) ) { |
131 | QTextStream ts( &file ); | 132 | QTextStream ts( &file ); |
132 | ts.setEncoding( QTextStream::Latin1 ); | 133 | ts.setEncoding( QTextStream::Latin1 ); |