author | ulf69 <ulf69> | 2004-08-03 20:49:15 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-03 20:49:15 (UTC) |
commit | be52d7d03e57620919b23cb0cbb33ac22d0920e0 (patch) (side-by-side diff) | |
tree | 34e8e29a221c828424126694f865d702c7635f97 /kabc/plugins/opie | |
parent | d5358380edce9a2c39f3eea4df741a148338880c (diff) | |
download | kdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.zip kdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.tar.gz kdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.tar.bz2 |
hopefully last modifications of resource based export/import functionality
for opie, qtopia and sharpdtm
-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 39 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopie.h | 10 |
2 files changed, 6 insertions, 43 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index 5559827..9dfd473 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp @@ -86,8 +86,9 @@ ResourceOpie::ResourceOpie( const QString &fileName, bool syncable ) } void ResourceOpie::init( const QString &fileName ) { + qDebug("ResourceOpie::init()"); connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); @@ -253,9 +254,13 @@ bool ResourceOpie::lock( const QString &lockfileName ) QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); kdDebug(5700) << "-- lock name: " << lockName << endl; - if (QFile::exists( lockName )) return false; + if (QFile::exists( lockName )) + { + qDebug("ResourceOpie::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName().latin1()); + return false; + } QString lockUniqueName; lockUniqueName = fn + KApplication::randomString( 8 ); @@ -339,37 +344,5 @@ void ResourceOpie::cleanUp() unlock( fileName() ); } -/** - * This method returns the number of elements that are currently in the resource. - */ -int ResourceOpie::count() const -{ - qDebug("ResourceOpie::count: %x", mAccess); - - if (mAccess != 0) - { - OContactAccess::List contactList = mAccess->allRecords(); - return contactList.count(); - } - else - return 0; -} - - -/** - * This method removes all elements from the resource!! (Not from the addressbook) - */ -bool ResourceOpie::clear() -{ - if (mAccess != 0) { - mAccess->clear(); - return true; - } - else - return false; -} - - - //US #include "resourceopie.moc" diff --git a/kabc/plugins/opie/resourceopie.h b/kabc/plugins/opie/resourceopie.h index ca30fee..d5b4ebd 100644 --- a/kabc/plugins/opie/resourceopie.h +++ b/kabc/plugins/opie/resourceopie.h @@ -121,18 +121,8 @@ public: * crashed */ virtual void cleanUp(); - /** - * This method returns the number of elements that are currently in the resource. - */ - virtual int count() const; - - /** - * This method removes all elements from the resource!! (Not from the addressbook) - */ - virtual bool clear(); - protected slots: void fileChanged(); |