-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 17 | ||||
-rw-r--r-- | kabc/plugins/dir/resourcedir.h | 3 |
2 files changed, 13 insertions, 7 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 @@ -56,6 +56,7 @@ $Id$ //US #include <qdir.h> +#define NO_DIRWATCH #include "resourcedir.h" #include "syncprefwidget.h" @@ -113,11 +114,11 @@ ResourceDir::ResourceDir( const KConfig *config, bool syncable ) else qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); */ - +#ifndef NO_DIRWATCH connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); - +#endif setPath( path ); } @@ -208,9 +209,9 @@ bool ResourceDir::save( Ticket *ticket ) { AddressBook::Iterator it; bool ok = true; - +#ifndef NO_DIRWATCH mDirWatch.stopScan(); - +#endif for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { if ( (*it).resource() != this || !(*it).changed() ) continue; @@ -228,8 +229,9 @@ bool ResourceDir::save( Ticket *ticket ) file.close(); } +#ifndef NO_DIRWATCH mDirWatch.startScan(); - +#endif delete ticket; #ifdef ALLOW_LOCKING unlock( mPath ); @@ -301,6 +303,7 @@ void ResourceDir::unlock( const QString &path ) void ResourceDir::setPath( const QString &path ) { +#ifndef NO_DIRWATCH mDirWatch.stopScan(); mDirWatch.removeDir( mPath ); @@ -308,7 +311,9 @@ void ResourceDir::setPath( const QString &path ) mDirWatch.addDir( mPath, true ); mDirWatch.startScan(); - +#else + mPath = path; +#endif //US simulate KDirWatch event //US pathChanged(); 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 @@ -104,8 +104,9 @@ protected: private: FormatPlugin *mFormat; +#ifndef NO_DIRWATCH KDirWatch mDirWatch; - +#endif QString mPath; QString mFormatName; QString mLockUniqueName; |