-rw-r--r-- | kabc/resource.cpp | 15 |
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 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (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 | ||
34 | using namespace KABC; | 34 | using namespace KABC; |
35 | 35 | ||
36 | Resource::Resource( const KConfig *config, bool syncable ) | 36 | Resource::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 | ||
46 | Resource::~Resource() | 46 | Resource::~Resource() |
47 | { | 47 | { |
48 | if (mSyncProfile != 0) { | 48 | if (mSyncProfile != 0) { |
49 | delete mSyncProfile; | 49 | delete mSyncProfile; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
53 | void Resource::writeConfig( KConfig *config ) | 53 | void 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 | ||
62 | void Resource::setAddressBook( AddressBook *ab ) | 62 | void Resource::setAddressBook( AddressBook *ab ) |
63 | { | 63 | { |
64 | mAddressBook = ab; | 64 | mAddressBook = ab; |
65 | } | 65 | } |
66 | 66 | ||
67 | AddressBook *Resource::addressBook() | 67 | AddressBook *Resource::addressBook() |
68 | { | 68 | { |
69 | return mAddressBook; | 69 | return mAddressBook; |
70 | } | 70 | } |
71 | 71 | ||
72 | bool Resource::doOpen() | 72 | bool Resource::doOpen() |
73 | { | 73 | { |
74 | return true; | 74 | return true; |
75 | } | 75 | } |
76 | 76 | ||
77 | void Resource::doClose() | 77 | void Resource::doClose() |
78 | { | 78 | { |
79 | } | 79 | } |
80 | 80 | ||
81 | Ticket *Resource::requestSaveTicket() | 81 | Ticket *Resource::requestSaveTicket() |
82 | { | 82 | { |
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | bool Resource::load() | 86 | bool Resource::load() |
87 | { | 87 | { |
88 | return true; | 88 | return true; |
89 | } | 89 | } |
90 | 90 | ||
91 | bool Resource::save( Ticket * ) | 91 | bool Resource::save( Ticket * ) |
92 | { | 92 | { |
93 | return false; | 93 | return false; |
94 | } | 94 | } |
95 | 95 | ||
96 | Ticket *Resource::createTicket( Resource *resource ) | 96 | Ticket *Resource::createTicket( Resource *resource ) |
97 | { | 97 | { |
98 | return new Ticket( resource ); | 98 | return new Ticket( resource ); |
99 | } | 99 | } |
100 | 100 | ||
101 | void Resource::removeAddressee( const Addressee& ) | 101 | void Resource::removeAddressee( const Addressee& ) |
102 | { | 102 | { |
103 | // do nothing | 103 | // do nothing |
104 | } | 104 | } |
105 | 105 | ||
106 | void Resource::cleanUp() | 106 | void Resource::cleanUp() |
107 | { | 107 | { |
108 | // do nothing | 108 | // do nothing |
109 | } | 109 | } |
110 | 110 | ||
111 | bool Resource::isSyncable() const | 111 | bool 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 | */ | ||
119 | int Resource::count() const | ||
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * This method removes all elements from the resource!! (Not from the addressbook) | ||
126 | */ | ||
127 | bool Resource::clear() | ||
128 | { | ||
129 | return false; | ||
130 | } | ||
131 | 116 | ||
132 | QString Resource::fileName() const | 117 | QString Resource::fileName() const |
133 | { | 118 | { |
134 | return mFileName; | 119 | return mFileName; |
135 | } | 120 | } |
136 | 121 | ||
137 | void Resource::setFileName( const QString &fileName ) | 122 | void 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 | */ |
146 | void Resource::setResourceName( const QString &name ) | 131 | void 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 | ||