summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprofile.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprofile.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprofile.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 2bf4e6c..76dfe00 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -34,95 +34,130 @@ KSyncProfile::KSyncProfile(): QObject ()
34{ 34{
35 setDefault(); 35 setDefault();
36} 36}
37KSyncProfile::~KSyncProfile() 37KSyncProfile::~KSyncProfile()
38{ 38{
39 39
40} 40}
41 41
42 42
43KSyncProfile* KSyncProfile::clone() 43KSyncProfile* KSyncProfile::clone()
44{ 44{
45 KSyncProfile* myClone = new KSyncProfile(); 45 KSyncProfile* myClone = new KSyncProfile();
46 myClone->setRemotePw(mRemotePw);
47 myClone->setRemoteIP(mRemoteIP);
48 myClone->setRemotePort(mRemotePort);
49 myClone->setRemotePwAB(mRemotePwAB);
50 myClone->setRemoteIPAB(mRemoteIPAB);
51 myClone->setRemotePortAB(mRemotePortAB);
52 myClone->setRemotePwPWM(mRemotePwPWM);
53 myClone->setRemoteIPPWM(mRemoteIPPWM);
54 myClone->setRemotePortPWM (mRemotePortPWM);
46 myClone->setPreSyncCommand( mPreSyncCommand ); 55 myClone->setPreSyncCommand( mPreSyncCommand );
47 myClone->setPostSyncCommand( mPostSyncCommand ); 56 myClone->setPostSyncCommand( mPostSyncCommand );
48 myClone->setLocalTempFile( mLocalTempFile); 57 myClone->setLocalTempFile( mLocalTempFile);
49 myClone->setRemoteFileName( mRemoteFileName ); 58 myClone->setRemoteFileName( mRemoteFileName );
50 myClone->setPreSyncCommandAB( mPreSyncCommandAB ); 59 myClone->setPreSyncCommandAB( mPreSyncCommandAB );
51 myClone->setPostSyncCommandAB( mPostSyncCommandAB ); 60 myClone->setPostSyncCommandAB( mPostSyncCommandAB );
52 myClone->setLocalTempFileAB( mLocalTempFileAB); 61 myClone->setLocalTempFileAB( mLocalTempFileAB);
53 myClone->setRemoteFileNameAB( mRemoteFileNameAB ); 62 myClone->setRemoteFileNameAB( mRemoteFileNameAB );
54 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM ); 63 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM );
55 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM ); 64 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM );
56 myClone->setLocalTempFilePWM( mLocalTempFilePWM); 65 myClone->setLocalTempFilePWM( mLocalTempFilePWM);
57 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM ); 66 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM );
58 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 67 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
59 myClone->setAskForPreferences( mAskForPreferences); 68 myClone->setAskForPreferences( mAskForPreferences);
60 myClone->setWriteBackExisting(mWriteBackExisting ); 69 myClone->setWriteBackExisting(mWriteBackExisting );
61 myClone->setWriteBackFile( mWriteBackFile); 70 myClone->setWriteBackFile( mWriteBackFile);
62 myClone->setWriteBackFuture( mWriteBackFuture ); 71 myClone->setWriteBackFuture( mWriteBackFuture );
63 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 72 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
64 myClone->setIncludeInRingSync( mIncludeInRingSync ); 73 myClone->setIncludeInRingSync( mIncludeInRingSync );
65 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 74 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
66 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); 75 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
67 myClone->setSyncPrefs( mSyncPrefs); 76 myClone->setSyncPrefs( mSyncPrefs);
68 myClone->setIsLocalFileSync( mIsLocalFileSync ); 77 myClone->setIsLocalFileSync( mIsLocalFileSync );
69 myClone->setIsPhoneSync( mIsPhoneSync ); 78 myClone->setIsPhoneSync( mIsPhoneSync );
79 myClone->setIsPiSync( mIsPiSync );
70 myClone->setWriteContactToSIM( mWriteContactToSIM ); 80 myClone->setWriteContactToSIM( mWriteContactToSIM );
71 myClone->setName( "noName" ); 81 myClone->setName( "noName" );
72 //myClone->setIdentifier( "noID" ); 82 //myClone->setIdentifier( "noID" );
73 return myClone; 83 return myClone;
74} 84}
75 85
76 86
77void KSyncProfile::setDefault() 87void KSyncProfile::setDefault()
78{ 88{
79 mPreSyncCommand = i18n("command for downloading remote file to local device"); 89 mPreSyncCommand = i18n("command for downloading remote file to local device");
80 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 90 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
81 mLocalTempFile = "/tmp/mycalendar.ics"; 91 mLocalTempFile = "/tmp/mycalendar.ics";
82 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; 92 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
83 mPreSyncCommandAB = i18n("command for downloading remote file to local device"); 93 mPreSyncCommandAB = i18n("command for downloading remote file to local device");
84 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); 94 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
85 mLocalTempFileAB = "/tmp/std.vcf"; 95 mLocalTempFileAB = "/tmp/std.vcf";
86 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; 96 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
87 mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); 97 mPreSyncCommandPWM = i18n("command for downloading remote file to local device");
88 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); 98 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
89 mLocalTempFilePWM = "/tmp/passwords.pwm"; 99 mLocalTempFilePWM = "/tmp/passwords.pwm";
90 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; 100 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
101
102 mRemotePw = "abc";
103 mRemoteIP = "192.168.0.99";
104 mRemotePort = "9197";
105
106 mRemotePwAB = "abc";
107 mRemoteIPAB = "192.168.0.99";
108 mRemotePortAB = "9198";
109
110 mRemotePwPWM = "abc";
111 mRemoteIPPWM = "192.168.0.99";
112 mRemotePortPWM = "9199";
113
91 mShowSummaryAfterSync = true; 114 mShowSummaryAfterSync = true;
92 mAskForPreferences = true; 115 mAskForPreferences = true;
93 mWriteBackExisting = false; 116 mWriteBackExisting = false;
94 mWriteBackFuture = false; 117 mWriteBackFuture = false;
95 mWriteBackFutureWeeks = 12; 118 mWriteBackFutureWeeks = 12;
96 mWriteBackFile = true; 119 mWriteBackFile = true;
97 mIncludeInRingSync = false; 120 mIncludeInRingSync = false;
98 mIncludeInRingSyncAB = false; 121 mIncludeInRingSyncAB = false;
99 mIncludeInRingSyncPWM = false; 122 mIncludeInRingSyncPWM = false;
100 mSyncPrefs = SYNC_PREF_ASK; 123 mSyncPrefs = SYNC_PREF_ASK;
101 mIsLocalFileSync = true; 124 mIsLocalFileSync = true;
102 mName = "noName"; 125 mName = "noName";
103 mIsPhoneSync = false; 126 mIsPhoneSync = false;
127 mIsPiSync = false;
104 mWriteContactToSIM = false; 128 mWriteContactToSIM = false;
105 mPhoneDevice = "/dev/ircomm"; 129 mPhoneDevice = "/dev/ircomm";
106 mPhoneConnection = "irda"; 130 mPhoneConnection = "irda";
107 mPhoneModel = "6310i"; 131 mPhoneModel = "6310i";
108} 132}
109void KSyncProfile::readConfig(KConfig *config ) 133void KSyncProfile::readConfig(KConfig *config )
110{ 134{
111 if (config) 135 if (config)
112 { 136 {
113 137
114 config->setGroup( mName ); 138 config->setGroup( mName );
115 139
116 mName = config->readEntry( "Name", mName ); 140 mName = config->readEntry( "Name", mName );
141
142 mRemotePw = config->readEntry( "RemotePw",mRemotePw );
143 mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP );
144 mRemotePort = config->readEntry( "RemotePort", mRemotePort );
145 mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB );
146 mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB );
147 mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB );
148 mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM );
149 mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM );
150 mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM );
151
117 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); 152 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
118 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); 153 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
119 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); 154 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
120 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); 155 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
121 156
122 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 157 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
123 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 158 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB );
124 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); 159 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB );
125 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 160 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB );
126 161
127 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 162 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
128 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); 163 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
@@ -137,40 +172,53 @@ void KSyncProfile::readConfig(KConfig *config )
137 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 172 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
138 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 173 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
139 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 174 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
140 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 175 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
141 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 176 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
142 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 177 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
143 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 178 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
144 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 179 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
145 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 180 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
146 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 181 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
147 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 182 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
148 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); 183 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
184 mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
149 } 185 }
150 else 186 else
151 { 187 {
152 setDefault(); 188 setDefault();
153 } 189 }
154} 190}
155 191
156void KSyncProfile::deleteConfig(KConfig *config ) 192void KSyncProfile::deleteConfig(KConfig *config )
157{ 193{
158 config->deleteGroup( mName ); 194 config->deleteGroup( mName );
159} 195}
160 196
161void KSyncProfile::writeConfig( KConfig * config ) 197void KSyncProfile::writeConfig( KConfig * config )
162{ 198{
163 config->setGroup(mName); 199 config->setGroup(mName);
164 200
201 config->writeEntry( "RemotePw", mRemotePw);
202 config->writeEntry( "RemoteIP", mRemoteIP);
203 config->writeEntry( "RemotePort", mRemotePort);
204
205 config->writeEntry( "RemotePwAB", mRemotePwAB);
206 config->writeEntry( "RemoteIPAB", mRemoteIPAB);
207 config->writeEntry( "RemotePortAB", mRemotePortAB);
208
209 config->writeEntry( "RemotePwPWM", mRemotePwPWM);
210 config->writeEntry( "RemoteIPPWM", mRemoteIPPWM);
211 config->writeEntry( "RemotePortPWM", mRemotePortPWM);
212
165 config->writeEntry( "Name", mName ); 213 config->writeEntry( "Name", mName );
166 config->writeEntry( "PreSyncCommand",mPreSyncCommand ); 214 config->writeEntry( "PreSyncCommand",mPreSyncCommand );
167 config->writeEntry( "PostSyncCommand", mPostSyncCommand ); 215 config->writeEntry( "PostSyncCommand", mPostSyncCommand );
168 config->writeEntry( "LocalTempFile", mLocalTempFile ); 216 config->writeEntry( "LocalTempFile", mLocalTempFile );
169 config->writeEntry( "RemoteFileName", mRemoteFileName ); 217 config->writeEntry( "RemoteFileName", mRemoteFileName );
170 218
171 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 219 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
172 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 220 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB );
173 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); 221 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB );
174 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 222 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB );
175 223
176 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 224 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
@@ -186,14 +234,15 @@ void KSyncProfile::writeConfig( KConfig * config )
186 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 234 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
187 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 235 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
188 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 236 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
189 config->writeEntry( "AskForPreferences",mAskForPreferences ); 237 config->writeEntry( "AskForPreferences",mAskForPreferences );
190 config->writeEntry( "WriteBackExisting",mWriteBackExisting ); 238 config->writeEntry( "WriteBackExisting",mWriteBackExisting );
191 config->writeEntry( "WriteBackFuture",mWriteBackFuture ); 239 config->writeEntry( "WriteBackFuture",mWriteBackFuture );
192 config->writeEntry( "WriteBackFile",mWriteBackFile ); 240 config->writeEntry( "WriteBackFile",mWriteBackFile );
193 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); 241 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
194 config->writeEntry( "SyncPrefs", mSyncPrefs ); 242 config->writeEntry( "SyncPrefs", mSyncPrefs );
195 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); 243 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
196 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); 244 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
197 config->writeEntry( "IsPhoneSync", mIsPhoneSync ); 245 config->writeEntry( "IsPhoneSync", mIsPhoneSync );
246 config->writeEntry( "IsPiSync", mIsPiSync );
198} 247}
199 248