author | zautrix <zautrix> | 2004-09-15 10:22:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-15 10:22:55 (UTC) |
commit | d4adafe41cf399585b8e35cb600ff35706d55ae0 (patch) (side-by-side diff) | |
tree | 1becc87f6c40390fd73082996d18f71fb5e9c772 /kabc/plugins/dir/resourcedir.cpp | |
parent | 8889ffd6f6958c3a1d07bafedcc8af5d786a1660 (diff) | |
download | kdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.zip kdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.tar.gz kdepimpi-d4adafe41cf399585b8e35cb600ff35706d55ae0.tar.bz2 |
fixes for desktop version
Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 17 |
1 files changed, 11 insertions, 6 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 @@ -55,8 +55,9 @@ $Id$ //US #include <qdir.h> +#define NO_DIRWATCH #include "resourcedir.h" #include "syncprefwidget.h" //#define ALLOW_LOCKING @@ -112,13 +113,13 @@ ResourceDir::ResourceDir( const KConfig *config, bool syncable ) mFormat = new BinaryFormat(); 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 ); } ResourceDir::~ResourceDir() @@ -207,11 +208,11 @@ bool ResourceDir::load() 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; @@ -227,10 +228,11 @@ bool ResourceDir::save( Ticket *ticket ) (*it).setChanged( false ); file.close(); } +#ifndef NO_DIRWATCH mDirWatch.startScan(); - +#endif delete ticket; #ifdef ALLOW_LOCKING unlock( mPath ); #endif @@ -300,16 +302,19 @@ void ResourceDir::unlock( const QString &path ) } void ResourceDir::setPath( const QString &path ) { +#ifndef NO_DIRWATCH mDirWatch.stopScan(); mDirWatch.removeDir( mPath ); mPath = path; mDirWatch.addDir( mPath, true ); mDirWatch.startScan(); - +#else + mPath = path; +#endif //US simulate KDirWatch event //US pathChanged(); } |