-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 39 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopie.h | 10 | ||||
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopia.cpp | 49 | ||||
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopia.h | 10 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 30 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.h | 10 |
6 files changed, 17 insertions, 131 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 @@ -89,2 +89,3 @@ void ResourceOpie::init( const QString &fileName ) { + qDebug("ResourceOpie::init()"); @@ -256,3 +257,7 @@ bool ResourceOpie::lock( const QString &lockfileName ) - 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; + } @@ -342,34 +347,2 @@ 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 @@ -124,12 +124,2 @@ public: - /** - * 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(); - diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp index 4a35f19..242e0c6 100644 --- a/kabc/plugins/qtopia/resourceqtopia.cpp +++ b/kabc/plugins/qtopia/resourceqtopia.cpp @@ -235,3 +235,7 @@ bool ResourceQtopia::lock( const QString &lockfileName ) - 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()); + return false; + } @@ -314,45 +318,2 @@ void ResourceQtopia::cleanUp() - - -/** - * This method returns the number of elements that are currently in the resource. - */ -int ResourceQtopia::count() const -{ - if (mAccess != 0) - { - int counter = 0; - AddressBookIterator it2(*mAccess); - for (it2.toFirst(); it2.current(); ++it2) { - counter++; - } - - return counter; - } - else - return 0; -} - - -/** - * This method removes all elements from the resource!! (Not from the addressbook) - */ -bool ResourceQtopia::clear() -{ - if (mAccess != 0) - { - AddressBookIterator it2(*mAccess); - for (it2.toFirst(); it2.current(); ++it2) { - mAccess->removeContact(*it2.current()); - } - return true; - } - else - return false; -} - - - - - //US #include "resourceqtopia.moc" diff --git a/kabc/plugins/qtopia/resourceqtopia.h b/kabc/plugins/qtopia/resourceqtopia.h index 90ab1f4..eace280 100644 --- a/kabc/plugins/qtopia/resourceqtopia.h +++ b/kabc/plugins/qtopia/resourceqtopia.h @@ -124,12 +124,2 @@ public: - /** - * 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: 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 @@ -251,3 +251,8 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) - 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; + } + @@ -330,25 +335,2 @@ void ResourceSharpDTM::cleanUp() -/** - * 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 @@ -124,12 +124,2 @@ public: - /** - * 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(); - |