-rw-r--r-- | libkdepim/ksyncprofile.cpp | 140 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 16 |
2 files changed, 89 insertions, 67 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index fcbb326..15dc152 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -1,173 +1,191 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | 24 | ||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 26 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile( const char * name): QObject (0, name ) | 33 | KSyncProfile::KSyncProfile( const char * identifier): QObject (0, identifier ) |
34 | { | 34 | { |
35 | setDefault(); | 35 | setIdentifier( identifier ); |
36 | |||
37 | if (getIdentifier().isEmpty()) | ||
38 | setIdentifier( "noID" ); | ||
39 | |||
40 | setDefault(); | ||
36 | } | 41 | } |
37 | KSyncProfile::~KSyncProfile() | 42 | KSyncProfile::~KSyncProfile() |
38 | { | 43 | { |
39 | 44 | ||
40 | } | 45 | } |
41 | 46 | ||
42 | 47 | ||
43 | KSyncProfile* KSyncProfile::clone() | 48 | KSyncProfile* KSyncProfile::clone() |
44 | { | 49 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 50 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setPreSyncCommand( mPreSyncCommand ); | 51 | myClone->setPreSyncCommand( mPreSyncCommand ); |
47 | myClone->setPostSyncCommand( mPostSyncCommand ); | 52 | myClone->setPostSyncCommand( mPostSyncCommand ); |
48 | myClone->setLocalTempFile( mLocalTempFile); | 53 | myClone->setLocalTempFile( mLocalTempFile); |
49 | myClone->setRemoteFileName( mRemoteFileName ); | 54 | myClone->setRemoteFileName( mRemoteFileName ); |
50 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); | 55 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); |
51 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); | 56 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); |
52 | myClone->setLocalTempFileAB( mLocalTempFileAB); | 57 | myClone->setLocalTempFileAB( mLocalTempFileAB); |
53 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); | 58 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); |
54 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 59 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
55 | myClone->setAskForPreferences( mAskForPreferences); | 60 | myClone->setAskForPreferences( mAskForPreferences); |
56 | myClone->setWriteBackExisting(mWriteBackExisting ); | 61 | myClone->setWriteBackExisting(mWriteBackExisting ); |
57 | myClone->setWriteBackFile( mWriteBackFile); | 62 | myClone->setWriteBackFile( mWriteBackFile); |
58 | myClone->setWriteBackFuture( mWriteBackFuture ); | 63 | myClone->setWriteBackFuture( mWriteBackFuture ); |
59 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); | 64 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); |
60 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 65 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
61 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | 66 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); |
62 | myClone->setSyncPrefs( mSyncPrefs); | 67 | myClone->setSyncPrefs( mSyncPrefs); |
63 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 68 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
64 | myClone->setIsPhoneSync( mIsPhoneSync ); | 69 | myClone->setIsPhoneSync( mIsPhoneSync ); |
65 | myClone->setName( "noName" ); | 70 | myClone->setName( "noName" ); |
71 | myClone->setIdentifier( "noID" ); | ||
66 | return myClone; | 72 | return myClone; |
67 | } | 73 | } |
68 | 74 | ||
69 | 75 | ||
70 | void KSyncProfile::setDefault() | 76 | void KSyncProfile::setDefault() |
71 | { | 77 | { |
72 | mName = "noName"; | ||
73 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 78 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
74 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 79 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
75 | mLocalTempFile = "/tmp/mycalendar.ics"; | 80 | mLocalTempFile = "/tmp/mycalendar.ics"; |
76 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 81 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
77 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); | 82 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); |
78 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); | 83 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); |
79 | mLocalTempFileAB = "/tmp/std.vcf"; | 84 | mLocalTempFileAB = "/tmp/std.vcf"; |
80 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | 85 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; |
81 | mShowSummaryAfterSync = true; | 86 | mShowSummaryAfterSync = true; |
82 | mAskForPreferences = true; | 87 | mAskForPreferences = true; |
83 | mWriteBackExisting = false; | 88 | mWriteBackExisting = false; |
84 | mWriteBackFuture = false; | 89 | mWriteBackFuture = false; |
85 | mWriteBackFutureWeeks = 12; | 90 | mWriteBackFutureWeeks = 12; |
86 | mWriteBackFile = true; | 91 | mWriteBackFile = true; |
87 | mIncludeInRingSync = false; | 92 | mIncludeInRingSync = false; |
88 | mIncludeInRingSyncAB = false; | 93 | mIncludeInRingSyncAB = false; |
89 | mSyncPrefs = SYNC_PREF_ASK; | 94 | mSyncPrefs = SYNC_PREF_ASK; |
90 | mIsLocalFileSync = true; | 95 | mIsLocalFileSync = true; |
91 | mIsPhoneSync = false; | 96 | mName = "noName"; |
97 | mIsPhoneSync = false; | ||
92 | mPhoneDevice = "/dev/ircomm"; | 98 | mPhoneDevice = "/dev/ircomm"; |
93 | mPhoneConnection = "irda"; | 99 | mPhoneConnection = "irda"; |
94 | mPhoneModel = "6310i"; | 100 | mPhoneModel = "6310i"; |
95 | |||
96 | } | 101 | } |
97 | void KSyncProfile::readConfig(KConfig *config ) | 102 | void KSyncProfile::readConfig(KConfig *config ) |
98 | { | 103 | { |
99 | config->setGroup(mName); | 104 | if (config) |
100 | QString prefix = ""; | 105 | { |
101 | //mName = config->readEntry( prefix+ "Name", mName ); | 106 | |
102 | mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 107 | config->setGroup("SyncProfile_" + mIdentifier); |
103 | mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );; | 108 | |
104 | mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 109 | mName = config->readEntry( "Name", mName ); |
105 | mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 110 | mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); |
106 | 111 | mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); | |
107 | mPreSyncCommandAB = config->readEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); | 112 | mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); |
108 | mPostSyncCommandAB = config->readEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); | 113 | mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); |
109 | mLocalTempFileAB = config->readEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); | 114 | |
110 | mRemoteFileNameAB = config->readEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); | 115 | mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
111 | 116 | mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); | |
112 | 117 | mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); | |
113 | mPhoneDevice = config->readEntry( prefix+ "PhoneDevice", mPhoneDevice ); | 118 | mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
114 | mPhoneConnection = config->readEntry( prefix+ "PhoneConnection", mPhoneConnection ); | 119 | |
115 | mPhoneModel = config->readEntry( prefix+ "PhoneModel", mPhoneModel ); | 120 | mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); |
116 | 121 | mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); | |
117 | mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 122 | mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); |
118 | mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 123 | |
119 | mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 124 | mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); |
120 | mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 125 | mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
121 | mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 126 | mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
122 | mWriteBackFuture = config->readBoolEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); | 127 | mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); |
123 | mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 128 | mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); |
124 | mWriteBackFutureWeeks = config->readNumEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks ); | 129 | mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); |
125 | mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 130 | mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); |
126 | mIsPhoneSync= config->readBoolEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); | 131 | mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); |
132 | mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); | ||
133 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | setDefault(); | ||
138 | } | ||
127 | } | 139 | } |
140 | |||
141 | void KSyncProfile::deleteConfig(KConfig *config ) | ||
142 | { | ||
143 | config->deleteGroup( "SyncProfile_" + mIdentifier ); | ||
144 | } | ||
145 | |||
128 | void KSyncProfile::writeConfig( KConfig * config ) | 146 | void KSyncProfile::writeConfig( KConfig * config ) |
129 | { | 147 | { |
130 | config->setGroup(mName ); | 148 | config->setGroup("SyncProfile_" + mIdentifier); |
131 | QString prefix = ""; | 149 | |
132 | // config->writeEntry( prefix+ "Name", mName ); | 150 | config->writeEntry( "Name", mName ); |
133 | config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); | 151 | config->writeEntry( "PreSyncCommand",mPreSyncCommand ); |
134 | config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); | 152 | config->writeEntry( "PostSyncCommand", mPostSyncCommand ); |
135 | config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); | 153 | config->writeEntry( "LocalTempFile", mLocalTempFile ); |
136 | config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); | 154 | config->writeEntry( "RemoteFileName", mRemoteFileName ); |
137 | 155 | ||
138 | config->writeEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB ); | 156 | config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
139 | config->writeEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB ); | 157 | config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); |
140 | config->writeEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB ); | 158 | config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); |
141 | config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB ); | 159 | config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
142 | 160 | ||
143 | config->writeEntry( prefix+ "PhoneDevice", mPhoneDevice ); | 161 | config->writeEntry( "PhoneDevice", mPhoneDevice ); |
144 | config->writeEntry( prefix+ "PhoneConnection", mPhoneConnection ); | 162 | config->writeEntry( "PhoneConnection", mPhoneConnection ); |
145 | config->writeEntry( prefix+ "PhoneModel", mPhoneModel ); | 163 | config->writeEntry( "PhoneModel", mPhoneModel ); |
146 | 164 | ||
147 | config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync ); | 165 | config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); |
148 | config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 166 | config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
149 | config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 167 | config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
150 | config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences ); | 168 | config->writeEntry( "AskForPreferences",mAskForPreferences ); |
151 | config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); | 169 | config->writeEntry( "WriteBackExisting",mWriteBackExisting ); |
152 | config->writeEntry( prefix+ "WriteBackFuture",mWriteBackFuture ); | 170 | config->writeEntry( "WriteBackFuture",mWriteBackFuture ); |
153 | config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); | 171 | config->writeEntry( "SyncPrefs", mSyncPrefs ); |
154 | config->writeEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks); | 172 | config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); |
155 | config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); | 173 | config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); |
156 | config->writeEntry( prefix+ "IsPhoneSync", mIsPhoneSync ); | 174 | config->writeEntry( "IsPhoneSync", mIsPhoneSync ); |
157 | } | 175 | } |
158 | 176 | ||
159 | /* | 177 | /* |
160 | class KPrefsItemInt : public KPrefsItem { | 178 | class KPrefsItemInt : public KPrefsItem { |
161 | public: | 179 | public: |
162 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); | 180 | KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0); |
163 | virtual ~KPrefsItemInt() {} | 181 | virtual ~KPrefsItemInt() {} |
164 | 182 | ||
165 | void setDefault(); | 183 | void setDefault(); |
166 | void readConfig(KConfig *); | 184 | void readConfig(KConfig *); |
167 | void writeConfig(KConfig *); | 185 | void writeConfig(KConfig *); |
168 | 186 | ||
169 | private: | 187 | private: |
170 | int *mReference; | 188 | int *mReference; |
171 | int mDefault; | 189 | int mDefault; |
172 | }; | 190 | }; |
173 | */ | 191 | */ |
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 300f70f..8995def 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -1,138 +1,142 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library 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 GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef _KSYNCPROFILE_H | 20 | #ifndef _KSYNCPROFILE_H |
21 | #define _KSYNCPROFILE_H | 21 | #define _KSYNCPROFILE_H |
22 | 22 | ||
23 | #include <qptrlist.h> | 23 | #include <qptrlist.h> |
24 | #include <qcolor.h> | 24 | #include <qcolor.h> |
25 | #include <qfont.h> | 25 | #include <qfont.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | 29 | ||
30 | #include <libkcal/syncdefines.h> | 30 | #include <libkcal/syncdefines.h> |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | class KConfig; | 34 | class KConfig; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | @short Class for storing a preferences setting | 37 | @short Class for storing a preferences setting |
38 | @author Cornelius Schumacher | 38 | @author Cornelius Schumacher |
39 | @see KPref | 39 | @see KPref |
40 | 40 | ||
41 | This class represents one preferences setting as used by @ref KPrefs. | 41 | This class represents one preferences setting as used by @ref KPrefs. |
42 | Subclasses of KPrefsItem implement storage functions for a certain type of | 42 | Subclasses of KPrefsItem implement storage functions for a certain type of |
43 | setting. Normally you don't have to use this class directly. Use the special | 43 | setting. Normally you don't have to use this class directly. Use the special |
44 | addItem() functions of KPrefs instead. If you subclass this class you will | 44 | addItem() functions of KPrefs instead. If you subclass this class you will |
45 | have to register instances with the function KPrefs::addItem(). | 45 | have to register instances with the function KPrefs::addItem(). |
46 | */ | 46 | */ |
47 | class KSyncProfile : public QObject { | 47 | class KSyncProfile : public QObject { |
48 | public: | 48 | public: |
49 | KSyncProfile( const char * name = 0); | 49 | KSyncProfile( const char * identifier = 0); |
50 | ~KSyncProfile() ; | 50 | ~KSyncProfile() ; |
51 | 51 | ||
52 | KSyncProfile* clone(); | 52 | KSyncProfile* clone(); |
53 | void setDefault(); | 53 | void setDefault(); |
54 | void readConfig(KConfig *); | 54 | void readConfig(KConfig *); |
55 | void writeConfig(KConfig *); | 55 | void writeConfig(KConfig *); |
56 | void setName( const QString& n ) {mName = n;} | 56 | void deleteConfig(KConfig *); |
57 | QString getName( ) { return mName;} | 57 | |
58 | void setIdentifier( const QString& i ) {mIdentifier = i;} | ||
59 | QString getIdentifier( ) { return mIdentifier;} | ||
58 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} | 60 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} |
59 | QString getPreSyncCommand( ) { return mPreSyncCommand; } | 61 | QString getPreSyncCommand( ) { return mPreSyncCommand; } |
60 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} | 62 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} |
61 | QString getPostSyncCommand( ) { return mPostSyncCommand;} | 63 | QString getPostSyncCommand( ) { return mPostSyncCommand;} |
62 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} | 64 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} |
63 | QString getLocalTempFile( ) { return mLocalTempFile;} | 65 | QString getLocalTempFile( ) { return mLocalTempFile;} |
64 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} | 66 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} |
65 | QString getRemoteFileName( ) { return mRemoteFileName;} | 67 | QString getRemoteFileName( ) { return mRemoteFileName;} |
66 | 68 | ||
67 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} | 69 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} |
68 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } | 70 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } |
69 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} | 71 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} |
70 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} | 72 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} |
71 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} | 73 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} |
72 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} | 74 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} |
73 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} | 75 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} |
74 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} | 76 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} |
75 | 77 | ||
76 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} | 78 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} |
77 | QString getPhoneDevice( ) { return mPhoneDevice;} | 79 | QString getPhoneDevice( ) { return mPhoneDevice;} |
78 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} | 80 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} |
79 | QString getPhoneConnection( ) { return mPhoneConnection;} | 81 | QString getPhoneConnection( ) { return mPhoneConnection;} |
80 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} | 82 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} |
81 | QString getPhoneModel( ) { return mPhoneModel;} | 83 | QString getPhoneModel( ) { return mPhoneModel;} |
82 | /* | 84 | /* |
83 | void set( const QString& n ) { = n;} | 85 | void set( const QString& n ) { = n;} |
84 | QString get( ) { return ;} | 86 | QString get( ) { return ;} |
85 | */ | 87 | */ |
86 | 88 | ||
89 | void setName( const QString& n ) {mName = n;} | ||
90 | QString getName( ) { return mName;} | ||
87 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} | 91 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} |
88 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} | 92 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} |
89 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} | 93 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} |
90 | bool getAskForPreferences( ) { return mAskForPreferences;} | 94 | bool getAskForPreferences( ) { return mAskForPreferences;} |
91 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} | 95 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} |
92 | bool getWriteBackExisting( ) { return mWriteBackExisting;} | 96 | bool getWriteBackExisting( ) { return mWriteBackExisting;} |
93 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} | 97 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} |
94 | bool getWriteBackFuture( ) { return mWriteBackFuture;} | 98 | bool getWriteBackFuture( ) { return mWriteBackFuture;} |
95 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} | 99 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} |
96 | bool getWriteBackFile( ) { return mWriteBackFile;} | 100 | bool getWriteBackFile( ) { return mWriteBackFile;} |
97 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} | 101 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} |
98 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} | 102 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} |
99 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} | 103 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} |
100 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} | 104 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} |
101 | void setSyncPrefs( int n ) { mSyncPrefs= n;} | 105 | void setSyncPrefs( int n ) { mSyncPrefs= n;} |
102 | int getSyncPrefs( ) { return mSyncPrefs;} | 106 | int getSyncPrefs( ) { return mSyncPrefs;} |
103 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} | 107 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} |
104 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} | 108 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} |
105 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} | 109 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} |
106 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} | 110 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} |
107 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} | 111 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} |
108 | bool getIsPhoneSync( ) { return mIsPhoneSync;} | 112 | bool getIsPhoneSync( ) { return mIsPhoneSync;} |
109 | |||
110 | private: | 113 | private: |
111 | QString mName; | 114 | QString mName; |
115 | QString mIdentifier; | ||
112 | QString mPreSyncCommand; | 116 | QString mPreSyncCommand; |
113 | QString mPostSyncCommand; | 117 | QString mPostSyncCommand; |
114 | QString mLocalTempFile; | 118 | QString mLocalTempFile; |
115 | QString mRemoteFileName; | 119 | QString mRemoteFileName; |
116 | QString mPreSyncCommandAB; | 120 | QString mPreSyncCommandAB; |
117 | QString mPostSyncCommandAB; | 121 | QString mPostSyncCommandAB; |
118 | QString mLocalTempFileAB; | 122 | QString mLocalTempFileAB; |
119 | QString mRemoteFileNameAB; | 123 | QString mRemoteFileNameAB; |
120 | 124 | ||
121 | QString mPhoneDevice; | 125 | QString mPhoneDevice; |
122 | QString mPhoneConnection; | 126 | QString mPhoneConnection; |
123 | QString mPhoneModel; | 127 | QString mPhoneModel; |
124 | 128 | ||
125 | bool mIncludeInRingSync; | 129 | bool mIncludeInRingSync; |
126 | bool mIncludeInRingSyncAB; | 130 | bool mIncludeInRingSyncAB; |
127 | int mSyncPrefs; | 131 | int mSyncPrefs; |
128 | bool mWriteBackFile; | 132 | bool mWriteBackFile; |
129 | bool mWriteBackExisting; | 133 | bool mWriteBackExisting; |
130 | bool mWriteBackFuture; | 134 | bool mWriteBackFuture; |
131 | int mWriteBackFutureWeeks; | 135 | int mWriteBackFutureWeeks; |
132 | bool mAskForPreferences; | 136 | bool mAskForPreferences; |
133 | bool mShowSummaryAfterSync; | 137 | bool mShowSummaryAfterSync; |
134 | bool mIsLocalFileSync; | 138 | bool mIsLocalFileSync; |
135 | bool mIsPhoneSync; | 139 | bool mIsPhoneSync; |
136 | }; | 140 | }; |
137 | 141 | ||
138 | #endif | 142 | #endif |