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/sharpdtm') diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index 14f272d..70c3718 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp @@ -249,7 +249,12 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) kdDebug(5700) << "-- lock name: " << lockName << endl; - if (QFile::exists( lockName )) return false; + if (QFile::exists( lockName )) + { + qDebug("ResourceSharpDTM::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName()); + return false; + } + QString lockUniqueName; lockUniqueName = fn + KApplication::randomString( 8 ); @@ -328,28 +333,5 @@ void ResourceSharpDTM::cleanUp() unlock( fileName() ); } -/** - * This method returns the number of elements that are currently in the resource. - */ -int ResourceSharpDTM::count() const -{ - if (mAccess != 0) - return mAccess->count(); - else - return 0; -} - - -/** - * This method removes all elements from the resource!! (Not from the addressbook) - */ -bool ResourceSharpDTM::clear() -{ - if (mAccess != 0) - return mAccess->deleteCard(0, SlZDataBase::AllCard ); - else - return false; -} - diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.h b/kabc/plugins/sharpdtm/resourcesharpdtm.h index 60d38a1..f386e69 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.h +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.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