summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/sharpdtm
Side-by-side diff
Diffstat (limited to 'kabc/plugins/sharpdtm') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp35
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.h32
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmE.pro2
3 files changed, 49 insertions, 20 deletions
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
@@ -2,3 +2,3 @@
This file is part of libkabc.
- Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (c) 2004 Ulf Schenk
@@ -64,4 +64,4 @@ extern "C"
-ResourceSharpDTM::ResourceSharpDTM( const KConfig *config )
- : Resource( config ), mConverter (0)
+ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable )
+ : Resource( config, syncable ), mConverter (0)
{
@@ -73,4 +73,4 @@ ResourceSharpDTM::ResourceSharpDTM( const KConfig *config )
-ResourceSharpDTM::ResourceSharpDTM( const QString &fileName )
- : Resource( 0 )
+ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable )
+ : Resource( 0, syncable )
{
@@ -357 +357,26 @@ 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 d2e2a52..f495e9d 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.h
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.h
@@ -2,3 +2,3 @@
This file is part of libkabc.
- Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
+ Copyright (c) 2004 Ulf Schenk
@@ -58,3 +58,3 @@ public:
*/
- ResourceSharpDTM( const KConfig *cfg );
+ ResourceSharpDTM( const KConfig *cfg, bool syncable );
@@ -63,3 +63,3 @@ public:
*/
- ResourceSharpDTM( const QString &fileName );
+ ResourceSharpDTM( const QString &fileName, bool syncable );
@@ -106,22 +106,28 @@ public:
/**
+ * Remove a addressee from its source.
+ * This method is mainly called by KABC::AddressBook.
+ */
+ virtual void removeAddressee( const Addressee& addr );
+
+ /**
* Set name of file to be used for saving.
*/
- void setFileName( const QString & );
+ virtual void setFileName( const QString & );
/**
- * Return name of file used for loading and saving the address book.
+ * This method is called by an error handler if the application
+ * crashed
*/
- QString fileName() const;
+ virtual void cleanUp();
/**
- * Remove a addressee from its source.
- * This method is mainly called by KABC::AddressBook.
+ * This method returns the number of elements that are currently in the resource.
*/
- virtual void removeAddressee( const Addressee& addr );
+ virtual int count() const;
/**
- * This method is called by an error handler if the application
- * crashed
+ * This method removes all elements from the resource!! (Not from the addressbook)
*/
- virtual void cleanUp();
+ virtual bool clear();
+
@@ -139,4 +145,2 @@ private:
- QString mFileName;
-
QString mLockUniqueName;
diff --git a/kabc/plugins/sharpdtm/sharpdtmE.pro b/kabc/plugins/sharpdtm/sharpdtmE.pro
index 54ef083..52bc10f 100644
--- a/kabc/plugins/sharpdtm/sharpdtmE.pro
+++ b/kabc/plugins/sharpdtm/sharpdtmE.pro
@@ -4,3 +4,3 @@ TARGET = microkabc_sharpdtm
-INCLUDEPATH += ../.. $(SHARPDTMSDK)/include ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat $(QPEDIR)/include
+INCLUDEPATH += ../.. $(SHARPDTMSDK)/include ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources ../../../qtcompat $(QPEDIR)/include