summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-14 14:58:04 (UTC)
committer ulf69 <ulf69>2004-07-14 14:58:04 (UTC)
commiteff6207dd2b2cbd8624845782b24f00fd6a2b64a (patch) (unidiff)
tree4572aff369f49f1c6dd2d9d88f1016a9e85f176d
parentf2779e5e7742103ce848ab11e6b9fe3661587f0b (diff)
downloadkdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.zip
kdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.tar.gz
kdepimpi-eff6207dd2b2cbd8624845782b24f00fd6a2b64a.tar.bz2
added support for kdirwatch
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp32
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 )
91 91
92/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
93 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 92 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
@@ -95,3 +94,3 @@ void ResourceOpie::init( const QString &fileName )
95 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 94 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
96*/ 95
97 //US opie addressbook is always readonly 96 //US opie addressbook is always readonly
@@ -287,5 +286,2 @@ bool ResourceOpie::lock( const QString &fileName )
287{ 286{
288 qDebug("ResourceOpie::lock() has to be fixed - %s", mFileName.latin1());
289
290/*US
291// qDebug("ResourceOpie::lock() %s", fileName.latin1()); 287// qDebug("ResourceOpie::lock() %s", fileName.latin1());
@@ -320,5 +316,7 @@ bool ResourceOpie::lock( const QString &fileName )
320 // Create lock file 316 // Create lock file
321 int result = ::link( QFile::encodeName( mLockUniqueName ), 317 int result = 0;
318#ifndef _WIN32_
319 result = ::link( QFile::encodeName( mLockUniqueName ),
322 QFile::encodeName( lockName ) ); 320 QFile::encodeName( lockName ) );
323 321#endif
324 if ( result == 0 ) { 322 if ( result == 0 ) {
@@ -331,5 +329,2 @@ bool ResourceOpie::lock( const QString &fileName )
331 return false; 329 return false;
332*/
333
334 return true;
335} 330}
@@ -338,4 +333,2 @@ void ResourceOpie::unlock( const QString &fileName )
338{ 333{
339 qDebug("ResourceOpie::unlock() has to be fixed - %s", mFileName.latin1());
340/*US
341// qDebug("ResourceOpie::unlock() %s", fileName.latin1()); 334// qDebug("ResourceOpie::unlock() %s", fileName.latin1());
@@ -353,3 +346,2 @@ void ResourceOpie::unlock( const QString &fileName )
353 addressBook()->emitAddressBookUnlocked(); 346 addressBook()->emitAddressBookUnlocked();
354*/
355} 347}
@@ -358,15 +350,12 @@ void ResourceOpie::setFileName( const QString &fileName )
358{ 350{
359/*US ToDo: no synchronization so far. Has to be changed in the future
360 mDirWatch.stopScan(); 351 mDirWatch.stopScan();
361 mDirWatch.removeFile( mFileName ); 352 mDirWatch.removeFile( mFileName );
362*/ 353
363 mFileName = fileName; 354 mFileName = fileName;
364
365 355
366/*US ToDo: no synchronization so far. Has to be changed in the future
367 mDirWatch.addFile( mFileName ); 356 mDirWatch.addFile( mFileName );
368 mDirWatch.startScan(); 357 mDirWatch.startScan();
369*/ 358
370//US simulate KDirWatch event 359//US simulate KDirWatch event
371 fileChanged(); 360//US fileChanged();
372} 361}
@@ -390,7 +379,2 @@ void ResourceOpie::removeAddressee( const Addressee &addr )
390{ 379{
391/*US
392 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) );
393 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) );
394 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) );
395*/
396} 380}