summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/sharpdtm/resourcesharpdtm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp30
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
@@ -249,7 +249,12 @@ bool ResourceSharpDTM::lock( const QString &lockfileName )
249 249
250 kdDebug(5700) << "-- lock name: " << lockName << endl; 250 kdDebug(5700) << "-- lock name: " << lockName << endl;
251 251
252 if (QFile::exists( lockName )) return false; 252 if (QFile::exists( lockName ))
253 {
254 qDebug("ResourceSharpDTM::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName());
255 return false;
256 }
257
253 258
254 QString lockUniqueName; 259 QString lockUniqueName;
255 lockUniqueName = fn + KApplication::randomString( 8 ); 260 lockUniqueName = fn + KApplication::randomString( 8 );
@@ -328,28 +333,5 @@ void ResourceSharpDTM::cleanUp()
328 unlock( fileName() ); 333 unlock( fileName() );
329} 334}
330 335
331/**
332 * This method returns the number of elements that are currently in the resource.
333 */
334int ResourceSharpDTM::count() const
335{
336 if (mAccess != 0)
337 return mAccess->count();
338 else
339 return 0;
340}
341
342
343/**
344 * This method removes all elements from the resource!! (Not from the addressbook)
345 */
346bool ResourceSharpDTM::clear()
347{
348 if (mAccess != 0)
349 return mAccess->deleteCard(0, SlZDataBase::AllCard );
350 else
351 return false;
352}
353
354 336
355 337