summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir
authorulf69 <ulf69>2004-08-20 19:53:52 (UTC)
committer ulf69 <ulf69>2004-08-20 19:53:52 (UTC)
commita3083042bb9c69193cc43105e6c9d045bd79e8b2 (patch) (unidiff)
tree6d89eb16d0661b03316117aca6f919339ef5df1d /kabc/plugins/dir
parentb42c4af4200c67802ee0cc57e10e1464903736b7 (diff)
downloadkdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.zip
kdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.tar.gz
kdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.tar.bz2
merged bugfix from KDE Head: Don't KDirWatch for own changes
Diffstat (limited to 'kabc/plugins/dir') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp3
1 files changed, 3 insertions, 0 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
@@ -201,41 +201,44 @@ bool ResourceDir::load()
201 } 201 }
202 202
203 return ok; 203 return ok;
204} 204}
205 205
206bool ResourceDir::save( Ticket *ticket ) 206bool 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 ) ) {
219 addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); 221 addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) );
220 continue; 222 continue;
221 } 223 }
222 224
223 mFormat->save( *it, &file ); 225 mFormat->save( *it, &file );
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}
236 239
237bool ResourceDir::lock( const QString &path ) 240bool ResourceDir::lock( const QString &path )
238{ 241{
239 kdDebug(5700) << "ResourceDir::lock()" << endl; 242 kdDebug(5700) << "ResourceDir::lock()" << endl;
240 243
241 QString p = path; 244 QString p = path;