summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2004-10-22 22:10:16 (UTC)
committer zautrix <zautrix>2004-10-22 22:10:16 (UTC)
commitb8da6435b8e5941eb1824873e68d8a6a728fae5e (patch) (unidiff)
treebc5ed11961e89bcd606f6fbca32185dbf8afab7a /libkdepim
parenta5274f27dc71e1a0ffae73f32f84f4dd013b4b76 (diff)
downloadkdepimpi-b8da6435b8e5941eb1824873e68d8a6a728fae5e.zip
kdepimpi-b8da6435b8e5941eb1824873e68d8a6a728fae5e.tar.gz
kdepimpi-b8da6435b8e5941eb1824873e68d8a6a728fae5e.tar.bz2
fixed an ugly timezone bug
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kpimglobalprefs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 7cd6038..0a580ca 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,139 +1,139 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (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 "kpimglobalprefs.h" 38#include "kpimglobalprefs.h"
39 39
40KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 40KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
41static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 41static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
42 42
43 43
44KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 44KPimGlobalPrefs::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, ("+01:00 Europe/Oslo(CET)") );
61 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 61 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
62 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false); 62 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false);
63 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 63 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
64 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 64 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
65 65
66 KPrefs::setCurrentGroup( "ExternalApplications" ); 66 KPrefs::setCurrentGroup( "ExternalApplications" );
67 67
68 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 68 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
69 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 69 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
70 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 70 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
71 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 71 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
72 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 72 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
73 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 73 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
74 74
75 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 75 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
76 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 76 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
77 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 77 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
78 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 78 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
79 79
80 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 80 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
81 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 81 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
82 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 82 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
83 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 83 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
84 84
85 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 85 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
86 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 86 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
87 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 87 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
88 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 88 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
89 89
90 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 90 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
91 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 91 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
92 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 92 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
93 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 93 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
94 94
95 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); 95 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC );
96 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 96 addItemString( "SIPChannel", &mSipOtherChannel, "" );
97 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 97 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
98 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 98 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
99 99
100 KPrefs::setCurrentGroup( "PhoneAccess" ); 100 KPrefs::setCurrentGroup( "PhoneAccess" );
101 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); 101 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm");
102 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); 102 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
103 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); 103 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
104 104
105} 105}
106 106
107 107
108void KPimGlobalPrefs::setGlobalConfig() 108void KPimGlobalPrefs::setGlobalConfig()
109{ 109{
110 110
111 KGlobal::locale()->setHore24Format( !mPreferredTime ); 111 KGlobal::locale()->setHore24Format( !mPreferredTime );
112 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); 112 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
113 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); 113 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
114 KGlobal::locale()->setLanguage( mPreferredLanguage ); 114 KGlobal::locale()->setLanguage( mPreferredLanguage );
115 QString dummy = mUserDateFormatLong; 115 QString dummy = mUserDateFormatLong;
116 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 116 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
117 dummy = mUserDateFormatShort; 117 dummy = mUserDateFormatShort;
118 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 118 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
119 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, 119 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
120 mDaylightsavingStart, 120 mDaylightsavingStart,
121 mDaylightsavingEnd ); 121 mDaylightsavingEnd );
122 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); 122 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min );
123 123
124} 124}
125KPimGlobalPrefs::~KPimGlobalPrefs() 125KPimGlobalPrefs::~KPimGlobalPrefs()
126{ 126{
127 //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); 127 //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() ");
128 writeConfig(); 128 writeConfig();
129} 129}
130 130
131KPimGlobalPrefs *KPimGlobalPrefs::instance() 131KPimGlobalPrefs *KPimGlobalPrefs::instance()
132{ 132{
133 if ( !sInstance ) { 133 if ( !sInstance ) {
134 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 134 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
135 sInstance->readConfig(); 135 sInstance->readConfig();
136 } 136 }
137 137
138 return sInstance; 138 return sInstance;
139} 139}