summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2004-10-23 12:27:21 (UTC)
committer zautrix <zautrix>2004-10-23 12:27:21 (UTC)
commit73c0cb5307a8276f628765c651ef0284b85d64de (patch) (unidiff)
tree790661de779d3eee77adef0aa46424356f144e50 /libkdepim
parent8d9c2228a82648e03eb6da800c84277a5f018c10 (diff)
downloadkdepimpi-73c0cb5307a8276f628765c651ef0284b85d64de.zip
kdepimpi-73c0cb5307a8276f628765c651ef0284b85d64de.tar.gz
kdepimpi-73c0cb5307a8276f628765c651ef0284b85d64de.tar.bz2
abc
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kpimglobalprefs.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 5298f0c..3771569 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,121 +1,119 @@
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 <qfile.h> 38#include <qfile.h>
39#include <qtextstream.h> 39#include <qtextstream.h>
40#include <qapplication.h> 40#include <qapplication.h>
41#include "kpimglobalprefs.h" 41#include "kpimglobalprefs.h"
42 42
43KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 43KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
44static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; 44static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP;
45 45
46 46
47KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 47KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
48 : KPrefs("microkdeglobalrc") 48 : KPrefs("microkdeglobalrc")
49{ 49{
50 mLocaleDict = 0; 50 mLocaleDict = 0;
51 KPrefs::setCurrentGroup("Locale"); 51 KPrefs::setCurrentGroup("Locale");
52 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 52 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
53 addItemInt("PreferredTime",&mPreferredTime,0); 53 addItemInt("PreferredTime",&mPreferredTime,0);
54 addItemInt("PreferredDate",&mPreferredDate,0); 54 addItemInt("PreferredDate",&mPreferredDate,0);
55 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 55 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
56 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
57 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
58 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 56 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
59 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 57 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
60 58
61 KPrefs::setCurrentGroup("Time & Date"); 59 KPrefs::setCurrentGroup("Time & Date");
62 60
63 addItemString("TimeZoneName",&mTimeZoneId, ("+01:00 Europe/Oslo(CET)") ); 61 addItemString("TimeZoneName",&mTimeZoneId, ("+01:00 Europe/Oslo(CET)") );
64 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 62 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
65 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false); 63 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false);
66 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 64 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
67 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 65 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
68 66
69 KPrefs::setCurrentGroup( "ExternalApplications" ); 67 KPrefs::setCurrentGroup( "ExternalApplications" );
70 68
71 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
72 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 70 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
73 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
74 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
75 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
76 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
77 75
78 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
79 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
80 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
81 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
82 80
83 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
84 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 82 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
85 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
86 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
87 85
88 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
89 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 87 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
90 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
91 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
92 90
93 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
94 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 92 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
95 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
96 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
97 95
98 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); 96 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC );
99 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 97 addItemString( "SIPChannel", &mSipOtherChannel, "" );
100 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
101 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
102 100
103 KPrefs::setCurrentGroup( "PhoneAccess" ); 101 KPrefs::setCurrentGroup( "PhoneAccess" );
104 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); 102 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm");
105 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); 103 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
106 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); 104 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
107 105
108} 106}
109 107
110void KPimGlobalPrefs::setGlobalConfig() 108void KPimGlobalPrefs::setGlobalConfig()
111{ 109{
112 if ( mLocaleDict == 0 ) { 110 if ( mLocaleDict == 0 ) {
113 QString fileName ; 111 QString fileName ;
114 QString name = KGlobal::getAppName() +"/"; 112 QString name = KGlobal::getAppName() +"/";
115#ifndef DESKTOP_VERSION 113#ifndef DESKTOP_VERSION
116 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name 114 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name
117#else 115#else
118 fileName = qApp->applicationDirPath () + "/kdepim/"+ name; 116 fileName = qApp->applicationDirPath () + "/kdepim/"+ name;
119#endif 117#endif
120 mLocaleDict = 0; 118 mLocaleDict = 0;
121 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) { 119 if ( mPreferredLanguage > 0 && mPreferredLanguage < 5 ) {