Diffstat (limited to 'kabc/plugins/file/resourcefile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
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 @@ -50,5 +50,5 @@ $Id$ #include "resourcefileconfig.h" #include "stdaddressbook.h" - +#define NO_DIRWATCH #include "resourcefile.h" #include "syncprefwidget.h" @@ -56,4 +56,6 @@ $Id$ //#define ALLOW_LOCKING + + using namespace KABC; @@ -116,9 +118,9 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) } - +#ifndef NO_DIRWATCH connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); - +#endif setFileName( fileName ); } @@ -228,6 +230,7 @@ bool ResourceFile::save( Ticket *ticket ) //US ToDo: write backupfile +#ifndef NO_DIRWATCH mDirWatch.stopScan(); - +#endif QFile info; info.setName( mFileName ); @@ -245,7 +248,7 @@ bool ResourceFile::save( Ticket *ticket ) if ( !ok ) addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); - +#ifndef NO_DIRWATCH mDirWatch.startScan(); - +#endif delete ticket; #ifdef ALLOW_LOCKING @@ -327,7 +330,7 @@ void ResourceFile::unlock( const QString &fileName ) void ResourceFile::setFileName( const QString &fileName ) { +#ifndef NO_DIRWATCH mDirWatch.stopScan(); mDirWatch.removeFile( mFileName ); - mFileName = fileName; @@ -335,4 +338,7 @@ void ResourceFile::setFileName( const QString &fileName ) mDirWatch.addFile( mFileName ); mDirWatch.startScan(); +#else + mFileName = fileName; +#endif //US simulate KDirWatch event |