From 863c4c3678e59ef125c08c00e9532ded5b540f67 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Mon, 02 Aug 2004 18:32:08 +0000 Subject: added support for syncprofiles for resources and export/import capabilities --- (limited to 'kabc/plugins/sharpdtm/resourcesharpdtm.cpp') diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index 31b99ca..7b909de 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp @@ -1,6 +1,6 @@ /* This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher + Copyright (c) 2004 Ulf Schenk This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -62,8 +62,8 @@ extern "C" } } -ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) - : Resource( config ), mConverter (0) +ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable ) + : Resource( config, syncable ), mConverter (0) { // we can not choose the filename. Therefore use the default to display @@ -71,8 +71,8 @@ ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) init( fileName ); } -ResourceSharpDTM::ResourceSharpDTM( const QString &fileName ) - : Resource( 0 ) +ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable ) + : Resource( 0, syncable ) { // qDebug("ResourceFile::ResourceSharpDTM : 3 %s, %s", fileName.latin1(), formatName.latin1()); init( fileName ); @@ -355,3 +355,28 @@ void ResourceSharpDTM::cleanUp() unlock( mFileName ); } +/** + * 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; +} + + + -- cgit v0.9.0.2