From be52d7d03e57620919b23cb0cbb33ac22d0920e0 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 03 Aug 2004 20:49:15 +0000 Subject: hopefully last modifications of resource based export/import functionality for opie, qtopia and sharpdtm --- (limited to 'kabc/plugins/opie') 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 @@ -87,6 +87,7 @@ 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() ) ); @@ -254,7 +255,11 @@ bool ResourceOpie::lock( const QString &lockfileName ) 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 ); @@ -340,36 +345,4 @@ void ResourceOpie::cleanUp() } -/** - * 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 @@ -122,16 +122,6 @@ public: */ 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(); -- cgit v0.9.0.2