author | zautrix <zautrix> | 2004-10-18 22:08:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-18 22:08:36 (UTC) |
commit | 9fd09e806dfe3df5abdf70991b6ec170fed51078 (patch) (unidiff) | |
tree | dc708d0baa4ddb5773531750bcca6000fc7297f4 | |
parent | c051fdcc1e7abac87f74430a7fcf3e7099f3b062 (diff) | |
download | kdepimpi-9fd09e806dfe3df5abdf70991b6ec170fed51078.zip kdepimpi-9fd09e806dfe3df5abdf70991b6ec170fed51078.tar.gz kdepimpi-9fd09e806dfe3df5abdf70991b6ec170fed51078.tar.bz2 |
added 30min plus to timezone setting
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 5 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 1 | ||||
-rw-r--r-- | microkde/kdecore/klocale.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/klocale.h | 2 |
5 files changed, 12 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 1eef150..332f975 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -302,48 +302,53 @@ void KDEPIMConfigWidget::setupTimeZoneTab() | |||
302 | new QLabel( i18n("Timezone:"), timeZoneBox ); | 302 | new QLabel( i18n("Timezone:"), timeZoneBox ); |
303 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | 303 | mTimeZoneCombo = new QComboBox( timeZoneBox ); |
304 | if ( QApplication::desktop()->width() < 300 ) { | 304 | if ( QApplication::desktop()->width() < 300 ) { |
305 | mTimeZoneCombo->setMaximumWidth(150); | 305 | mTimeZoneCombo->setMaximumWidth(150); |
306 | } | 306 | } |
307 | 307 | ||
308 | QStringList list; | 308 | QStringList list; |
309 | list = KGlobal::locale()->timeZoneList(); | 309 | list = KGlobal::locale()->timeZoneList(); |
310 | mTimeZoneCombo->insertStringList(list); | 310 | mTimeZoneCombo->insertStringList(list); |
311 | 311 | ||
312 | // find the currently set time zone and select it | 312 | // find the currently set time zone and select it |
313 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; | 313 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; |
314 | int nCurrentlySet = 11; | 314 | int nCurrentlySet = 11; |
315 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | 315 | for (int i = 0; i < mTimeZoneCombo->count(); i++) |
316 | { | 316 | { |
317 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | 317 | if (mTimeZoneCombo->text(i) == sCurrentlySet) |
318 | { | 318 | { |
319 | nCurrentlySet = i; | 319 | nCurrentlySet = i; |
320 | break; | 320 | break; |
321 | } | 321 | } |
322 | } | 322 | } |
323 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | 323 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); |
324 | int iii = 1; | 324 | int iii = 1; |
325 | KPrefsWidBool *sb = | 325 | KPrefsWidBool *sb = |
326 | addWidBool(i18n("Add 30 min (+00:30) to selected Timezone"), | ||
327 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); | ||
328 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | ||
329 | ++iii; | ||
330 | sb = | ||
326 | addWidBool(i18n("Timezone has daylight saving"), | 331 | addWidBool(i18n("Timezone has daylight saving"), |
327 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); | 332 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); |
328 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 333 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
329 | ++iii; | 334 | ++iii; |
330 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | 335 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); |
331 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 336 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
332 | ++iii; | 337 | ++iii; |
333 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | 338 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); |
334 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 339 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
335 | ++iii; | 340 | ++iii; |
336 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | 341 | lab = new QLabel( i18n("Daylight start:"), topFrame ); |
337 | topLayout->addWidget(lab, iii,0); | 342 | topLayout->addWidget(lab, iii,0); |
338 | mStartDateSavingEdit = new KDateEdit(topFrame); | 343 | mStartDateSavingEdit = new KDateEdit(topFrame); |
339 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | 344 | topLayout->addWidget(mStartDateSavingEdit, iii,1); |
340 | ++iii; | 345 | ++iii; |
341 | 346 | ||
342 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | 347 | lab = new QLabel( i18n("Daylight end:"), topFrame ); |
343 | topLayout->addWidget(lab, iii,0); | 348 | topLayout->addWidget(lab, iii,0); |
344 | mEndDateSavingEdit = new KDateEdit(topFrame); | 349 | mEndDateSavingEdit = new KDateEdit(topFrame); |
345 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | 350 | topLayout->addWidget(mEndDateSavingEdit, iii,1); |
346 | ++iii; | 351 | ++iii; |
347 | QDate current ( 2001, 1,1); | 352 | QDate current ( 2001, 1,1); |
348 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); | 353 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); |
349 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); | 354 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); |
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 5081b26..04e2072 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp | |||
@@ -38,48 +38,49 @@ $Id$ | |||
38 | #include "kpimglobalprefs.h" | 38 | #include "kpimglobalprefs.h" |
39 | 39 | ||
40 | KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; | 40 | 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 | addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false); | ||
62 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); | 63 | addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); |
63 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); | 64 | addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); |
64 | 65 | ||
65 | KPrefs::setCurrentGroup( "ExternalApplications" ); | 66 | KPrefs::setCurrentGroup( "ExternalApplications" ); |
66 | 67 | ||
67 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); | 68 | addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); |
68 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); | 69 | addItemString( "EmailChannel", &mEmailOtherChannel, "" ); |
69 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); | 70 | addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); |
70 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); | 71 | addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); |
71 | addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); | 72 | addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); |
72 | addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); | 73 | addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); |
73 | 74 | ||
74 | addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); | 75 | addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); |
75 | addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); | 76 | addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); |
76 | addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); | 77 | addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); |
77 | addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); | 78 | addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); |
78 | 79 | ||
79 | addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); | 80 | addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); |
80 | addItemString( "FaxChannel", &mFaxOtherChannel, "" ); | 81 | addItemString( "FaxChannel", &mFaxOtherChannel, "" ); |
81 | addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); | 82 | addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); |
82 | addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); | 83 | addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); |
83 | 84 | ||
84 | addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); | 85 | addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); |
85 | addItemString( "SMSChannel", &mSMSOtherChannel, "" ); | 86 | addItemString( "SMSChannel", &mSMSOtherChannel, "" ); |
@@ -97,42 +98,42 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) | |||
97 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); | 98 | addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); |
98 | 99 | ||
99 | KPrefs::setCurrentGroup( "PhoneAccess" ); | 100 | KPrefs::setCurrentGroup( "PhoneAccess" ); |
100 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); | 101 | addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); |
101 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); | 102 | addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); |
102 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); | 103 | addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); |
103 | 104 | ||
104 | } | 105 | } |
105 | 106 | ||
106 | 107 | ||
107 | void KPimGlobalPrefs::setGlobalConfig() | 108 | void KPimGlobalPrefs::setGlobalConfig() |
108 | { | 109 | { |
109 | 110 | ||
110 | KGlobal::locale()->setHore24Format( !mPreferredTime ); | 111 | KGlobal::locale()->setHore24Format( !mPreferredTime ); |
111 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); | 112 | KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); |
112 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); | 113 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); |
113 | KGlobal::locale()->setLanguage( mPreferredLanguage ); | 114 | KGlobal::locale()->setLanguage( mPreferredLanguage ); |
114 | QString dummy = mUserDateFormatLong; | 115 | QString dummy = mUserDateFormatLong; |
115 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 116 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
116 | dummy = mUserDateFormatShort; | 117 | dummy = mUserDateFormatShort; |
117 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 118 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
118 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, | 119 | KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, |
119 | mDaylightsavingStart, | 120 | mDaylightsavingStart, |
120 | mDaylightsavingEnd ); | 121 | mDaylightsavingEnd ); |
121 | KGlobal::locale()->setTimezone( mTimeZoneId ); | 122 | KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); |
122 | 123 | ||
123 | } | 124 | } |
124 | KPimGlobalPrefs::~KPimGlobalPrefs() | 125 | KPimGlobalPrefs::~KPimGlobalPrefs() |
125 | { | 126 | { |
126 | //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); | 127 | //qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() "); |
127 | writeConfig(); | 128 | writeConfig(); |
128 | } | 129 | } |
129 | 130 | ||
130 | KPimGlobalPrefs *KPimGlobalPrefs::instance() | 131 | KPimGlobalPrefs *KPimGlobalPrefs::instance() |
131 | { | 132 | { |
132 | if ( !sInstance ) { | 133 | if ( !sInstance ) { |
133 | sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); | 134 | sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); |
134 | sInstance->readConfig(); | 135 | sInstance->readConfig(); |
135 | } | 136 | } |
136 | 137 | ||
137 | return sInstance; | 138 | return sInstance; |
138 | } | 139 | } |
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index f6b6628..7c55099 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h | |||
@@ -75,48 +75,49 @@ class KPimGlobalPrefs : public KPrefs | |||
75 | 75 | ||
76 | enum SIPClients { | 76 | enum SIPClients { |
77 | NONE_SIC = 0, | 77 | NONE_SIC = 0, |
78 | OTHER_SIC = 1 | 78 | OTHER_SIC = 1 |
79 | }; | 79 | }; |
80 | 80 | ||
81 | private: | 81 | private: |
82 | KPimGlobalPrefs( const QString &name = QString::null ); | 82 | KPimGlobalPrefs( const QString &name = QString::null ); |
83 | 83 | ||
84 | static KPimGlobalPrefs *sInstance; | 84 | static KPimGlobalPrefs *sInstance; |
85 | 85 | ||
86 | 86 | ||
87 | public: | 87 | public: |
88 | //US I copied the following "locale" settings from KOPrefs | 88 | //US I copied the following "locale" settings from KOPrefs |
89 | int mPreferredDate; | 89 | int mPreferredDate; |
90 | QString mUserDateFormatLong; | 90 | QString mUserDateFormatLong; |
91 | QString mUserDateFormatShort; | 91 | QString mUserDateFormatShort; |
92 | int mPreferredLanguage; | 92 | int mPreferredLanguage; |
93 | int mPreferredTime; | 93 | int mPreferredTime; |
94 | bool mWeekStartsOnSunday; | 94 | bool mWeekStartsOnSunday; |
95 | QString mTimeZoneId; | 95 | QString mTimeZoneId; |
96 | bool mUseDaylightsaving; | 96 | bool mUseDaylightsaving; |
97 | int mDaylightsavingStart; | 97 | int mDaylightsavingStart; |
98 | int mDaylightsavingEnd; | 98 | int mDaylightsavingEnd; |
99 | bool mTimeZoneAdd30min; | ||
99 | 100 | ||
100 | int mEmailClient; | 101 | int mEmailClient; |
101 | QString mEmailOtherChannel; | 102 | QString mEmailOtherChannel; |
102 | QString mEmailOtherMessage; | 103 | QString mEmailOtherMessage; |
103 | QString mEmailOtherMessageParameters; | 104 | QString mEmailOtherMessageParameters; |
104 | QString mEmailOtherMessage2; | 105 | QString mEmailOtherMessage2; |
105 | QString mEmailOtherMessageParameters2; | 106 | QString mEmailOtherMessageParameters2; |
106 | 107 | ||
107 | int mPhoneClient; | 108 | int mPhoneClient; |
108 | QString mPhoneOtherChannel; | 109 | QString mPhoneOtherChannel; |
109 | QString mPhoneOtherMessage; | 110 | QString mPhoneOtherMessage; |
110 | QString mPhoneOtherMessageParameters; | 111 | QString mPhoneOtherMessageParameters; |
111 | 112 | ||
112 | int mFaxClient; | 113 | int mFaxClient; |
113 | QString mFaxOtherChannel; | 114 | QString mFaxOtherChannel; |
114 | QString mFaxOtherMessage; | 115 | QString mFaxOtherMessage; |
115 | QString mFaxOtherMessageParameters; | 116 | QString mFaxOtherMessageParameters; |
116 | 117 | ||
117 | int mSMSClient; | 118 | int mSMSClient; |
118 | QString mSMSOtherChannel; | 119 | QString mSMSOtherChannel; |
119 | QString mSMSOtherMessage; | 120 | QString mSMSOtherMessage; |
120 | QString mSMSOtherMessageParameters; | 121 | QString mSMSOtherMessageParameters; |
121 | 122 | ||
122 | int mPagerClient; | 123 | int mPagerClient; |
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 27acfec..673d845 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp | |||
@@ -798,51 +798,53 @@ void KLocale::insertCatalogue ( const QString & ) | |||
798 | } | 798 | } |
799 | 799 | ||
800 | KCalendarSystem *KLocale::calendar() | 800 | KCalendarSystem *KLocale::calendar() |
801 | { | 801 | { |
802 | if ( !mCalendarSystem ) { | 802 | if ( !mCalendarSystem ) { |
803 | mCalendarSystem = new KCalendarSystemGregorian; | 803 | mCalendarSystem = new KCalendarSystemGregorian; |
804 | } | 804 | } |
805 | 805 | ||
806 | return mCalendarSystem; | 806 | return mCalendarSystem; |
807 | } | 807 | } |
808 | 808 | ||
809 | int KLocale::timezoneOffset( QString timeZone ) | 809 | int KLocale::timezoneOffset( QString timeZone ) |
810 | { | 810 | { |
811 | int ret = 1001; | 811 | int ret = 1001; |
812 | int index = mTimeZoneList.findIndex( timeZone ); | 812 | int index = mTimeZoneList.findIndex( timeZone ); |
813 | if ( index < 24 ) | 813 | if ( index < 24 ) |
814 | ret = ( index-11 ) * 60 ; | 814 | ret = ( index-11 ) * 60 ; |
815 | return ret; | 815 | return ret; |
816 | } | 816 | } |
817 | 817 | ||
818 | QStringList KLocale::timeZoneList() const | 818 | QStringList KLocale::timeZoneList() const |
819 | { | 819 | { |
820 | return mTimeZoneList; | 820 | return mTimeZoneList; |
821 | } | 821 | } |
822 | void KLocale::setTimezone( const QString &timeZone ) | 822 | void KLocale::setTimezone( const QString &timeZone, bool oddTZ ) |
823 | { | 823 | { |
824 | mTimeZoneOffset = timezoneOffset( timeZone ); | 824 | mTimeZoneOffset = timezoneOffset( timeZone ); |
825 | if ( oddTZ ) | ||
826 | mTimeZoneOffset += 30; | ||
825 | } | 827 | } |
826 | 828 | ||
827 | void KLocale::setDaylightSaving( bool b, int start , int end ) | 829 | void KLocale::setDaylightSaving( bool b, int start , int end ) |
828 | { | 830 | { |
829 | daylightEnabled = b; | 831 | daylightEnabled = b; |
830 | daylightStart = start; | 832 | daylightStart = start; |
831 | daylightEnd = end; | 833 | daylightEnd = end; |
832 | mSouthDaylight = (end < start); | 834 | mSouthDaylight = (end < start); |
833 | // qDebug("klocale daylight %d %d %d ", b, start , end ); | 835 | // qDebug("klocale daylight %d %d %d ", b, start , end ); |
834 | } | 836 | } |
835 | 837 | ||
836 | int KLocale::localTimeOffset( const QDateTime &dt ) | 838 | int KLocale::localTimeOffset( const QDateTime &dt ) |
837 | { | 839 | { |
838 | bool addDaylight = false; | 840 | bool addDaylight = false; |
839 | if ( daylightEnabled ) { | 841 | if ( daylightEnabled ) { |
840 | int d_end, d_start; | 842 | int d_end, d_start; |
841 | int dayofyear = dt.date().dayOfYear(); | 843 | int dayofyear = dt.date().dayOfYear(); |
842 | int year = dt.date().year(); | 844 | int year = dt.date().year(); |
843 | int add = 0; | 845 | int add = 0; |
844 | if ( QDate::leapYear(year) ) | 846 | if ( QDate::leapYear(year) ) |
845 | add = 1; | 847 | add = 1; |
846 | QDate date ( year,1,1 ); | 848 | QDate date ( year,1,1 ); |
847 | if ( daylightEnd > 59 ) | 849 | if ( daylightEnd > 59 ) |
848 | d_end = daylightEnd +add; | 850 | d_end = daylightEnd +add; |
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h index 5783530..be9442c 100644 --- a/microkde/kdecore/klocale.h +++ b/microkde/kdecore/klocale.h | |||
@@ -74,45 +74,45 @@ class KLocale | |||
74 | 74 | ||
75 | KCalendarSystem *calendar(); | 75 | KCalendarSystem *calendar(); |
76 | void setHore24Format ( bool ); | 76 | void setHore24Format ( bool ); |
77 | void setWeekStartMonday( bool ); | 77 | void setWeekStartMonday( bool ); |
78 | void setIntDateFormat( IntDateFormat ); | 78 | void setIntDateFormat( IntDateFormat ); |
79 | void setIntTimeFormat( IntDateFormat ); | 79 | void setIntTimeFormat( IntDateFormat ); |
80 | IntDateFormat getIntDateFormat( ); | 80 | IntDateFormat getIntDateFormat( ); |
81 | IntDateFormat getIntTimeFormat( ); | 81 | IntDateFormat getIntTimeFormat( ); |
82 | void setLanguage( int ); | 82 | void setLanguage( int ); |
83 | void setDateFormat( QString ); | 83 | void setDateFormat( QString ); |
84 | void setDateFormatShort( QString ); | 84 | void setDateFormatShort( QString ); |
85 | 85 | ||
86 | QString m_decimalSymbol; | 86 | QString m_decimalSymbol; |
87 | QString m_thousandsSeparator; | 87 | QString m_thousandsSeparator; |
88 | QString m_currencySymbol; | 88 | QString m_currencySymbol; |
89 | QString m_monetaryDecimalSymbol; | 89 | QString m_monetaryDecimalSymbol; |
90 | QString m_monetaryThousandsSeparator; | 90 | QString m_monetaryThousandsSeparator; |
91 | QString m_positiveSign; | 91 | QString m_positiveSign; |
92 | QString m_negativeSign; | 92 | QString m_negativeSign; |
93 | 93 | ||
94 | int timezoneOffset( QString ); | 94 | int timezoneOffset( QString ); |
95 | QStringList timeZoneList() const; | 95 | QStringList timeZoneList() const; |
96 | void setDaylightSaving( bool, int , int ); | 96 | void setDaylightSaving( bool, int , int ); |
97 | int localTimeOffset(const QDateTime &); | 97 | int localTimeOffset(const QDateTime &); |
98 | void setTimezone( const QString &timeZone ); | 98 | void setTimezone( const QString &timeZone , bool oddTZ); |
99 | private: | 99 | private: |
100 | QTime readTime(const QString &str, bool seconds, bool *ok) const; | 100 | QTime readTime(const QString &str, bool seconds, bool *ok) const; |
101 | QDate readDate(const QString &str, bool shortFormat, bool *ok) const; | 101 | QDate readDate(const QString &str, bool shortFormat, bool *ok) const; |
102 | KCalendarSystem *mCalendarSystem; | 102 | KCalendarSystem *mCalendarSystem; |
103 | bool mWeekStartsMonday; | 103 | bool mWeekStartsMonday; |
104 | bool mHourF24Format; | 104 | bool mHourF24Format; |
105 | IntDateFormat mIntDateFormat; | 105 | IntDateFormat mIntDateFormat; |
106 | IntDateFormat mIntTimeFormat; | 106 | IntDateFormat mIntTimeFormat; |
107 | int mLanguage; | 107 | int mLanguage; |
108 | QString mDateFormat; | 108 | QString mDateFormat; |
109 | QString mDateFormatShort; | 109 | QString mDateFormatShort; |
110 | QStringList mTimeZoneList; | 110 | QStringList mTimeZoneList; |
111 | bool daylightEnabled; | 111 | bool daylightEnabled; |
112 | int mDaylightTZoffset; | 112 | int mDaylightTZoffset; |
113 | int mNondaylightTZoffset; | 113 | int mNondaylightTZoffset; |
114 | bool mSouthDaylight; | 114 | bool mSouthDaylight; |
115 | int daylightStart, daylightEnd, mTimeZoneOffset; | 115 | int daylightStart, daylightEnd, mTimeZoneOffset; |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #endif | 118 | #endif |