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.cpp35
1 files changed, 30 insertions, 5 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
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
@@ -62,8 +62,8 @@ extern "C"
62 } 62 }
63} 63}
64 64
65ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) 65ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable )
66 : Resource( config ), mConverter (0) 66 : Resource( config, syncable ), mConverter (0)
67{ 67{
68 // we can not choose the filename. Therefore use the default to display 68 // we can not choose the filename. Therefore use the default to display
69 69
@@ -71,8 +71,8 @@ ResourceSharpDTM::ResourceSharpDTM( const KConfig *config )
71 init( fileName ); 71 init( fileName );
72} 72}
73 73
74ResourceSharpDTM::ResourceSharpDTM( const QString &fileName ) 74ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable )
75 : Resource( 0 ) 75 : Resource( 0, syncable )
76{ 76{
77// qDebug("ResourceFile::ResourceSharpDTM : 3 %s, %s", fileName.latin1(), formatName.latin1()); 77// qDebug("ResourceFile::ResourceSharpDTM : 3 %s, %s", fileName.latin1(), formatName.latin1());
78 init( fileName ); 78 init( fileName );
@@ -355,3 +355,28 @@ void ResourceSharpDTM::cleanUp()
355 unlock( mFileName ); 355 unlock( mFileName );
356} 356}
357 357
358/**
359 * This method returns the number of elements that are currently in the resource.
360 */
361int ResourceSharpDTM::count() const
362{
363 if (mAccess != 0)
364 return mAccess->count();
365 else
366 return 0;
367}
368
369
370/**
371 * This method removes all elements from the resource!! (Not from the addressbook)
372 */
373bool ResourceSharpDTM::clear()
374{
375 if (mAccess != 0)
376 return mAccess->deleteCard(0, SlZDataBase::AllCard );
377 else
378 return false;
379}
380
381
382