-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index b71e18d..5081b26 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -41,100 +41,98 @@ KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; | |||
41 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; | 41 | static KStaticDeleter<KPimGlobalPrefs> staticDeleter; |
42 | 42 | ||
43 | 43 | ||
44 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | 44 | KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) |
45 | : KPrefs("microkdeglobalrc") | 45 | : KPrefs("microkdeglobalrc") |
46 | { | 46 | { |
47 | 47 | ||
48 | KPrefs::setCurrentGroup("Locale"); | 48 | KPrefs::setCurrentGroup("Locale"); |
49 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); | 49 | addItemInt("PreferredLanguage",&mPreferredLanguage,0); |
50 | addItemInt("PreferredTime",&mPreferredTime,0); | 50 | addItemInt("PreferredTime",&mPreferredTime,0); |
51 | addItemInt("PreferredDate",&mPreferredDate,0); | 51 | addItemInt("PreferredDate",&mPreferredDate,0); |
52 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); | 52 | addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); |
53 | //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); | 53 | //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); |
54 | // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); | 54 | // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); |
55 | addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); | 55 | addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); |
56 | addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); | 56 | addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); |
57 | 57 | ||
58 | KPrefs::setCurrentGroup("Time & Date"); | 58 | KPrefs::setCurrentGroup("Time & Date"); |
59 | 59 | ||
60 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); | 60 | addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); |
61 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); | 61 | addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); |
62 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); | 62 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); |
63 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); | 63 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); |
64 | 64 | ||
65 | |||
66 | |||
67 | |||
68 | KPrefs::setCurrentGroup( "ExternalApplications" ); | 65 | KPrefs::setCurrentGroup( "ExternalApplications" ); |
69 | 66 | ||
70 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); | 67 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); |
71 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); | 68 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); |
72 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); | 69 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); |
73 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); | 70 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); |
74 | addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); | 71 | addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); |
75 | addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); | 72 | addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); |
76 | 73 | ||
77 | addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); | 74 | addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); |
78 | addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); | 75 | addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); |
79 | addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); | 76 | addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); |
80 | addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); | 77 | addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); |
81 | 78 | ||
82 | addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); | 79 | addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); |
83 | addItemString( "FaxChannel", &mFaxOtherChannel, "" ); | 80 | addItemString( "FaxChannel", &mFaxOtherChannel, "" ); |
84 | addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); | 81 | addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); |
85 | addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); | 82 | addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); |
86 | 83 | ||
87 | addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); | 84 | addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); |
88 | addItemString( "SMSChannel", &mSMSOtherChannel, "" ); | 85 | addItemString( "SMSChannel", &mSMSOtherChannel, "" ); |
89 | addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); | 86 | addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); |
90 | addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); | 87 | addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); |
91 | 88 | ||
92 | addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); | 89 | addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); |
93 | addItemString( "PagerChannel", &mPagerOtherChannel, "" ); | 90 | addItemString( "PagerChannel", &mPagerOtherChannel, "" ); |
94 | addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); | 91 | addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); |
95 | addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); | 92 | addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); |
96 | 93 | ||
97 | addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); | 94 | addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); |
98 | addItemString( "SIPChannel", &mSipOtherChannel, "" ); | 95 | addItemString( "SIPChannel", &mSipOtherChannel, "" ); |
99 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); | 96 | addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); |
100 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); | 97 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); |
101 | 98 | ||
102 | |||
103 | KPrefs::setCurrentGroup( "PhoneAccess" ); | 99 | KPrefs::setCurrentGroup( "PhoneAccess" ); |
104 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); | 100 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); |
105 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); | 101 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); |
106 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); | 102 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); |
107 | 103 | ||
108 | |||
109 | } | 104 | } |
110 | 105 | ||
106 | |||
111 | void KPimGlobalPrefs::setGlobalConfig() | 107 | void KPimGlobalPrefs::setGlobalConfig() |
112 | { | 108 | { |
113 | 109 | ||
114 | KGlobal::locale()->setHore24Format( !mPreferredTime ); | 110 | KGlobal::locale()->setHore24Format( !mPreferredTime ); |
115 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); | 111 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); |
116 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); | 112 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); |
117 | KGlobal::locale()->setLanguage( mPreferredLanguage ); | 113 | KGlobal::locale()->setLanguage( mPreferredLanguage ); |
118 | QString dummy = mUserDateFormatLong; | 114 | QString dummy = mUserDateFormatLong; |
119 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 115 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
120 | dummy = mUserDateFormatShort; | 116 | dummy = mUserDateFormatShort; |
121 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 117 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
122 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, | 118 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, |
123 | mDaylightsavingStart, | 119 | mDaylightsavingStart, |
124 | mDaylightsavingEnd ); | 120 | mDaylightsavingEnd ); |
125 | KGlobal::locale()->setTimezone( mTimeZoneId ); | 121 | KGlobal::locale()->setTimezone( mTimeZoneId ); |
126 | 122 | ||
127 | } | 123 | } |
128 | KPimGlobalPrefs::~KPimGlobalPrefs() | 124 | KPimGlobalPrefs::~KPimGlobalPrefs() |
129 | { | 125 | { |
126 | //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); | ||
127 | writeConfig(); | ||
130 | } | 128 | } |
131 | 129 | ||
132 | KPimGlobalPrefs *KPimGlobalPrefs::instance() | 130 | KPimGlobalPrefs *KPimGlobalPrefs::instance() |
133 | { | 131 | { |
134 | if ( !sInstance ) { | 132 | if ( !sInstance ) { |
135 | sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); | 133 | sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); |
136 | sInstance->readConfig(); | 134 | sInstance->readConfig(); |
137 | } | 135 | } |
138 | 136 | ||
139 | return sInstance; | 137 | return sInstance; |
140 | } | 138 | } |