summaryrefslogtreecommitdiffabout
path: root/kabc
Unidiff
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp17
-rw-r--r--kabc/plugins/dir/resourcedir.h3
-rw-r--r--kabc/plugins/file/resourcefile.cpp20
-rw-r--r--kabc/plugins/file/resourcefile.h3
4 files changed, 28 insertions, 15 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 7d96cb7..e58e4f7 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -58,2 +58,3 @@ $Id$
58 58
59#define NO_DIRWATCH
59#include "resourcedir.h" 60#include "resourcedir.h"
@@ -115,3 +116,3 @@ ResourceDir::ResourceDir( const KConfig *config, bool syncable )
115*/ 116*/
116 117#ifndef NO_DIRWATCH
117 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 118 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
@@ -119,3 +120,3 @@ ResourceDir::ResourceDir( const KConfig *config, bool syncable )
119 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); 120 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
120 121#endif
121 setPath( path ); 122 setPath( path );
@@ -210,5 +211,5 @@ bool ResourceDir::save( Ticket *ticket )
210 bool ok = true; 211 bool ok = true;
211 212#ifndef NO_DIRWATCH
212 mDirWatch.stopScan(); 213 mDirWatch.stopScan();
213 214#endif
214 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 215 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
@@ -230,4 +231,5 @@ bool ResourceDir::save( Ticket *ticket )
230 } 231 }
232#ifndef NO_DIRWATCH
231 mDirWatch.startScan(); 233 mDirWatch.startScan();
232 234#endif
233 delete ticket; 235 delete ticket;
@@ -303,2 +305,3 @@ void ResourceDir::setPath( const QString &path )
303{ 305{
306#ifndef NO_DIRWATCH
304 mDirWatch.stopScan(); 307 mDirWatch.stopScan();
@@ -310,3 +313,5 @@ void ResourceDir::setPath( const QString &path )
310 mDirWatch.startScan(); 313 mDirWatch.startScan();
311 314#else
315 mPath = path;
316#endif
312//US simulate KDirWatch event 317//US simulate KDirWatch event
diff --git a/kabc/plugins/dir/resourcedir.h b/kabc/plugins/dir/resourcedir.h
index c2aedad..77cd18c 100644
--- a/kabc/plugins/dir/resourcedir.h
+++ b/kabc/plugins/dir/resourcedir.h
@@ -106,4 +106,5 @@ private:
106 106
107#ifndef NO_DIRWATCH
107 KDirWatch mDirWatch; 108 KDirWatch mDirWatch;
108 109#endif
109 QString mPath; 110 QString mPath;
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index 17263ae..b8c32d5 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -51,3 +51,3 @@ $Id$
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52 52#define NO_DIRWATCH
53#include "resourcefile.h" 53#include "resourcefile.h"
@@ -57,2 +57,4 @@ $Id$
57 57
58
59
58using namespace KABC; 60using namespace KABC;
@@ -117,3 +119,3 @@ void ResourceFile::init( const QString &fileName, const QString &formatName )
117 119
118 120#ifndef NO_DIRWATCH
119 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 121 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
@@ -121,3 +123,3 @@ void ResourceFile::init( const QString &fileName, const QString &formatName )
121 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 123 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
122 124#endif
123 setFileName( fileName ); 125 setFileName( fileName );
@@ -229,4 +231,5 @@ bool ResourceFile::save( Ticket *ticket )
229//US ToDo: write backupfile 231//US ToDo: write backupfile
232#ifndef NO_DIRWATCH
230 mDirWatch.stopScan(); 233 mDirWatch.stopScan();
231 234#endif
232 QFile info; 235 QFile info;
@@ -246,5 +249,5 @@ bool ResourceFile::save( Ticket *ticket )
246 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); 249 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) );
247 250#ifndef NO_DIRWATCH
248 mDirWatch.startScan(); 251 mDirWatch.startScan();
249 252#endif
250 delete ticket; 253 delete ticket;
@@ -328,5 +331,5 @@ void ResourceFile::setFileName( const QString &fileName )
328{ 331{
332#ifndef NO_DIRWATCH
329 mDirWatch.stopScan(); 333 mDirWatch.stopScan();
330 mDirWatch.removeFile( mFileName ); 334 mDirWatch.removeFile( mFileName );
331
332 mFileName = fileName; 335 mFileName = fileName;
@@ -336,2 +339,5 @@ void ResourceFile::setFileName( const QString &fileName )
336 mDirWatch.startScan(); 339 mDirWatch.startScan();
340#else
341 mFileName = fileName;
342#endif
337 343
diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h
index 0a3027c..8339340 100644
--- a/kabc/plugins/file/resourcefile.h
+++ b/kabc/plugins/file/resourcefile.h
@@ -155,4 +155,5 @@ private:
155 QString mLockUniqueName; 155 QString mLockUniqueName;
156 156#ifndef NO_DIRWATCH
157 KDirWatch mDirWatch; 157 KDirWatch mDirWatch;
158#endif
158}; 159};