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/sharpdtm/resourcesharpdtm.cpp | |
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
Diffstat (limited to 'kabc/plugins/sharpdtm/resourcesharpdtm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
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 @@ -246,13 +246,18 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) KURL url(fn); 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("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 ); url = lockUniqueName; //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); @@ -325,31 +330,8 @@ void ResourceSharpDTM::removeAddressee( const Addressee &addr ) 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; -} - |