summaryrefslogtreecommitdiffabout
path: root/kabc/resource.cpp
Unidiff
Diffstat (limited to 'kabc/resource.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/resource.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/kabc/resource.cpp b/kabc/resource.cpp
index 9632a3f..2f03927 100644
--- a/kabc/resource.cpp
+++ b/kabc/resource.cpp
@@ -20,135 +20,120 @@
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include <ksyncprofile.h> 30#include <ksyncprofile.h>
31 31
32#include "resource.h" 32#include "resource.h"
33 33
34using namespace KABC; 34using namespace KABC;
35 35
36Resource::Resource( const KConfig *config, bool syncable ) 36Resource::Resource( const KConfig *config, bool syncable )
37 : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 ) 37 : KRES::Resource( config ), mAddressBook( 0 ), mSyncProfile( 0 )
38{ 38{
39 if(syncable == true) { 39 if(syncable == true) {
40 mSyncProfile = new KSyncProfile( identifier() ); 40 mSyncProfile = new KSyncProfile( identifier() );
41 mSyncProfile->setName(resourceName()); 41 mSyncProfile->setName(resourceName());
42 mSyncProfile->readConfig( (KConfig *)config ); 42 mSyncProfile->readConfig( (KConfig *)config );
43 } 43 }
44} 44}
45 45
46Resource::~Resource() 46Resource::~Resource()
47{ 47{
48 if (mSyncProfile != 0) { 48 if (mSyncProfile != 0) {
49 delete mSyncProfile; 49 delete mSyncProfile;
50 } 50 }
51} 51}
52 52
53void Resource::writeConfig( KConfig *config ) 53void Resource::writeConfig( KConfig *config )
54{ 54{
55 KRES::Resource::writeConfig( config ); 55 KRES::Resource::writeConfig( config );
56 56
57 if(mSyncProfile != 0) 57 if(mSyncProfile != 0)
58 mSyncProfile->writeConfig( config ); 58 mSyncProfile->writeConfig( config );
59} 59}
60 60
61 61
62void Resource::setAddressBook( AddressBook *ab ) 62void Resource::setAddressBook( AddressBook *ab )
63{ 63{
64 mAddressBook = ab; 64 mAddressBook = ab;
65} 65}
66 66
67AddressBook *Resource::addressBook() 67AddressBook *Resource::addressBook()
68{ 68{
69 return mAddressBook; 69 return mAddressBook;
70} 70}
71 71
72bool Resource::doOpen() 72bool Resource::doOpen()
73{ 73{
74 return true; 74 return true;
75} 75}
76 76
77void Resource::doClose() 77void Resource::doClose()
78{ 78{
79} 79}
80 80
81Ticket *Resource::requestSaveTicket() 81Ticket *Resource::requestSaveTicket()
82{ 82{
83 return 0; 83 return 0;
84} 84}
85 85
86bool Resource::load() 86bool Resource::load()
87{ 87{
88 return true; 88 return true;
89} 89}
90 90
91bool Resource::save( Ticket * ) 91bool Resource::save( Ticket * )
92{ 92{
93 return false; 93 return false;
94} 94}
95 95
96Ticket *Resource::createTicket( Resource *resource ) 96Ticket *Resource::createTicket( Resource *resource )
97{ 97{
98 return new Ticket( resource ); 98 return new Ticket( resource );
99} 99}
100 100
101void Resource::removeAddressee( const Addressee& ) 101void Resource::removeAddressee( const Addressee& )
102{ 102{
103 // do nothing 103 // do nothing
104} 104}
105 105
106void Resource::cleanUp() 106void Resource::cleanUp()
107{ 107{
108 // do nothing 108 // do nothing
109} 109}
110 110
111bool Resource::isSyncable() const 111bool Resource::isSyncable() const
112{ 112{
113 return (mSyncProfile != 0); 113 return (mSyncProfile != 0);
114} 114}
115 115
116/**
117 * This method returns the number of elements that are currently in the resource.
118 */
119int Resource::count() const
120{
121 return 0;
122}
123
124/**
125 * This method removes all elements from the resource!! (Not from the addressbook)
126 */
127bool Resource::clear()
128{
129 return false;
130}
131 116
132QString Resource::fileName() const 117QString Resource::fileName() const
133{ 118{
134 return mFileName; 119 return mFileName;
135} 120}
136 121
137void Resource::setFileName( const QString &fileName ) 122void Resource::setFileName( const QString &fileName )
138{ 123{
139 mFileName = fileName; 124 mFileName = fileName;
140} 125}
141 126
142/** 127/**
143 * Set the name of resource.You can override this method, 128 * Set the name of resource.You can override this method,
144 * but also remember to call Resource::setResourceName(). 129 * but also remember to call Resource::setResourceName().
145 */ 130 */
146void Resource::setResourceName( const QString &name ) 131void Resource::setResourceName( const QString &name )
147{ 132{
148 KRES::Resource::setResourceName(name); 133 KRES::Resource::setResourceName(name);
149 if(mSyncProfile != 0) { 134 if(mSyncProfile != 0) {
150 mSyncProfile->setName( name ); 135 mSyncProfile->setName( name );
151 } 136 }
152 137
153} 138}
154 139