author | ulf69 <ulf69> | 2004-07-14 14:58:04 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-14 14:58:04 (UTC) |
commit | eff6207dd2b2cbd8624845782b24f00fd6a2b64a (patch) (side-by-side diff) | |
tree | 4572aff369f49f1c6dd2d9d88f1016a9e85f176d | |
parent | f2779e5e7742103ce848ab11e6b9fe3661587f0b (diff) | |
download | kdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.zip kdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.tar.gz kdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.tar.bz2 |
added support for kdirwatch
-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index 3a40ea2..1436508 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp @@ -91,3 +91,2 @@ void ResourceOpie::init( const QString &fileName ) -/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); @@ -95,3 +94,3 @@ void ResourceOpie::init( const QString &fileName ) connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); -*/ + //US opie addressbook is always readonly @@ -287,5 +286,2 @@ bool ResourceOpie::lock( const QString &fileName ) { - qDebug("ResourceOpie::lock() has to be fixed - %s", mFileName.latin1()); - -/*US // qDebug("ResourceOpie::lock() %s", fileName.latin1()); @@ -320,5 +316,7 @@ bool ResourceOpie::lock( const QString &fileName ) // Create lock file - int result = ::link( QFile::encodeName( mLockUniqueName ), + int result = 0; +#ifndef _WIN32_ + result = ::link( QFile::encodeName( mLockUniqueName ), QFile::encodeName( lockName ) ); - +#endif if ( result == 0 ) { @@ -331,5 +329,2 @@ bool ResourceOpie::lock( const QString &fileName ) return false; -*/ - - return true; } @@ -338,4 +333,2 @@ void ResourceOpie::unlock( const QString &fileName ) { - qDebug("ResourceOpie::unlock() has to be fixed - %s", mFileName.latin1()); -/*US // qDebug("ResourceOpie::unlock() %s", fileName.latin1()); @@ -353,3 +346,2 @@ void ResourceOpie::unlock( const QString &fileName ) addressBook()->emitAddressBookUnlocked(); -*/ } @@ -358,15 +350,12 @@ void ResourceOpie::setFileName( const QString &fileName ) { -/*US ToDo: no synchronization so far. Has to be changed in the future mDirWatch.stopScan(); mDirWatch.removeFile( mFileName ); -*/ - mFileName = fileName; + mFileName = fileName; -/*US ToDo: no synchronization so far. Has to be changed in the future mDirWatch.addFile( mFileName ); mDirWatch.startScan(); -*/ + //US simulate KDirWatch event - fileChanged(); +//US fileChanged(); } @@ -390,7 +379,2 @@ void ResourceOpie::removeAddressee( const Addressee &addr ) { -/*US - QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) ); - QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) ); - QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) ); -*/ } |