summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp3
-rw-r--r--kabc/plugins/file/resourcefile.cpp7
-rw-r--r--kabc/plugins/opie/resourceopie.cpp4
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp3
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp2
5 files changed, 15 insertions, 4 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index eccd482..fac06a1 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -207,12 +207,14 @@ bool ResourceDir::save( Ticket *ticket )
207{ 207{
208 kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl; 208 kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl;
209 209
210 AddressBook::Iterator it; 210 AddressBook::Iterator it;
211 bool ok = true; 211 bool ok = true;
212 212
213 mDirWatch.stopScan();
214
213 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 215 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
214 if ( (*it).resource() != this || !(*it).changed() ) 216 if ( (*it).resource() != this || !(*it).changed() )
215 continue; 217 continue;
216 218
217 QFile file( mPath + "/" + (*it).uid() ); 219 QFile file( mPath + "/" + (*it).uid() );
218 if ( !file.open( IO_WriteOnly ) ) { 220 if ( !file.open( IO_WriteOnly ) ) {
@@ -224,12 +226,13 @@ bool ResourceDir::save( Ticket *ticket )
224 226
225 // mark as unchanged 227 // mark as unchanged
226 (*it).setChanged( false ); 228 (*it).setChanged( false );
227 229
228 file.close(); 230 file.close();
229 } 231 }
232 mDirWatch.startScan();
230 233
231 delete ticket; 234 delete ticket;
232 unlock( mPath ); 235 unlock( mPath );
233 236
234 return ok; 237 return ok;
235} 238}
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index da2e4d7..fa6bc49 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -222,12 +222,14 @@ bool ResourceFile::save( Ticket *ticket )
222 mFormat->saveAll( addressBook(), this, saveFile.file() ); 222 mFormat->saveAll( addressBook(), this, saveFile.file() );
223 ok = saveFile.close(); 223 ok = saveFile.close();
224 } 224 }
225*/ 225*/
226 226
227//US ToDo: write backupfile 227//US ToDo: write backupfile
228 mDirWatch.stopScan();
229
228 QFile info; 230 QFile info;
229 info.setName( mFileName ); 231 info.setName( mFileName );
230 bool ok = info.open( IO_WriteOnly ); 232 bool ok = info.open( IO_WriteOnly );
231 if ( ok ) { 233 if ( ok ) {
232 mFormat->saveAll( addressBook(), this, &info ); 234 mFormat->saveAll( addressBook(), this, &info );
233 235
@@ -238,19 +240,18 @@ bool ResourceFile::save( Ticket *ticket )
238 240
239 } 241 }
240 242
241 if ( !ok ) 243 if ( !ok )
242 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); 244 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) );
243 245
246 mDirWatch.startScan();
247
244 delete ticket; 248 delete ticket;
245 unlock( mFileName ); 249 unlock( mFileName );
246 250
247 return ok; 251 return ok;
248
249 qDebug("ResourceFile::save has to be changed");
250 return true;
251} 252}
252 253
253bool ResourceFile::lock( const QString &fileName ) 254bool ResourceFile::lock( const QString &fileName )
254{ 255{
255 256
256 257
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 4b811e9..22237dc 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -208,13 +208,13 @@ bool ResourceOpie::load()
208} 208}
209 209
210bool ResourceOpie::save( Ticket *ticket ) 210bool ResourceOpie::save( Ticket *ticket )
211{ 211{
212 qDebug("ResourceOpie::save: %s", fileName().latin1()); 212 qDebug("ResourceOpie::save: %s", fileName().latin1());
213 213
214 214 mDirWatch.stopScan();
215 215
216 KABC::AddressBook::Iterator it; 216 KABC::AddressBook::Iterator it;
217 bool res; 217 bool res;
218 218
219 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 219 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
220 OContact c; 220 OContact c;
@@ -232,12 +232,14 @@ bool ResourceOpie::save( Ticket *ticket )
232 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1()); 232 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
233 } 233 }
234 } 234 }
235 235
236 mAccess->save(); 236 mAccess->save();
237 237
238 mDirWatch.startScan();
239
238 delete ticket; 240 delete ticket;
239 unlock( fileName() ); 241 unlock( fileName() );
240 242
241 return true; 243 return true;
242 244
243} 245}
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 93a4d33..48a9f22 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -188,12 +188,13 @@ bool ResourceQtopia::load()
188} 188}
189 189
190bool ResourceQtopia::save( Ticket *ticket ) 190bool ResourceQtopia::save( Ticket *ticket )
191{ 191{
192 qDebug("ResourceQtopia::save: %s", fileName().latin1()); 192 qDebug("ResourceQtopia::save: %s", fileName().latin1());
193 193
194 mDirWatch.stopScan();
194 195
195 KABC::AddressBook::Iterator it; 196 KABC::AddressBook::Iterator it;
196 bool res; 197 bool res;
197 198
198 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 199 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
199 PimContact c; 200 PimContact c;
@@ -211,12 +212,14 @@ bool ResourceQtopia::save( Ticket *ticket )
211 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1()); 212 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
212 } 213 }
213 } 214 }
214 215
215// mAccess->addressBookUpdated(); 216// mAccess->addressBookUpdated();
216 217
218 mDirWatch.startScan();
219
217 delete ticket; 220 delete ticket;
218 unlock( fileName() ); 221 unlock( fileName() );
219 222
220 return true; 223 return true;
221} 224}
222 225
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index b63df0c..8a795e9 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -194,12 +194,13 @@ bool ResourceSharpDTM::load()
194} 194}
195 195
196bool ResourceSharpDTM::save( Ticket *ticket ) 196bool ResourceSharpDTM::save( Ticket *ticket )
197{ 197{
198 qDebug("ResourceSharpDTM::save: %s", fileName().latin1()); 198 qDebug("ResourceSharpDTM::save: %s", fileName().latin1());
199 199
200 mDirWatch.stopScan();
200 201
201 KABC::AddressBook::Iterator it; 202 KABC::AddressBook::Iterator it;
202 bool res; 203 bool res;
203 204
204 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 205 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
205 CardId id = 0;// 0 means new card 206 CardId id = 0;// 0 means new card
@@ -227,12 +228,13 @@ bool ResourceSharpDTM::save( Ticket *ticket )
227 } 228 }
228 229
229 } 230 }
230 231
231//US mAccess->save(); 232//US mAccess->save();
232 233
234 mDirWatch.startScan();
233 delete ticket; 235 delete ticket;
234 unlock( fileName() ); 236 unlock( fileName() );
235 237
236 return true; 238 return true;
237} 239}
238 240