summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/opie/resourceopie.cpp
Side-by-side diff
Diffstat (limited to 'kabc/plugins/opie/resourceopie.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp39
1 files changed, 6 insertions, 33 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
@@ -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"