summaryrefslogtreecommitdiffabout
path: root/kabc/plugins
authorulf69 <ulf69>2004-08-03 20:49:15 (UTC)
committer ulf69 <ulf69>2004-08-03 20:49:15 (UTC)
commitbe52d7d03e57620919b23cb0cbb33ac22d0920e0 (patch) (unidiff)
tree34e8e29a221c828424126694f865d702c7635f97 /kabc/plugins
parentd5358380edce9a2c39f3eea4df741a148338880c (diff)
downloadkdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.zip
kdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.tar.gz
kdepimpi-be52d7d03e57620919b23cb0cbb33ac22d0920e0.tar.bz2
hopefully last modifications of resource based export/import functionality
for opie, qtopia and sharpdtm
Diffstat (limited to 'kabc/plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp39
-rw-r--r--kabc/plugins/opie/resourceopie.h10
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp49
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.h10
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp30
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.h10
6 files changed, 17 insertions, 131 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 5559827..9dfd473 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -89,2 +89,3 @@ void ResourceOpie::init( const QString &fileName )
89{ 89{
90 qDebug("ResourceOpie::init()");
90 91
@@ -256,3 +257,7 @@ bool ResourceOpie::lock( const QString &lockfileName )
256 257
257 if (QFile::exists( lockName )) return false; 258 if (QFile::exists( lockName ))
259 {
260 qDebug("ResourceOpie::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName().latin1());
261 return false;
262 }
258 263
@@ -342,34 +347,2 @@ void ResourceOpie::cleanUp()
342 347
343/**
344 * This method returns the number of elements that are currently in the resource.
345 */
346int ResourceOpie::count() const
347{
348 qDebug("ResourceOpie::count: %x", mAccess);
349
350 if (mAccess != 0)
351 {
352 OContactAccess::List contactList = mAccess->allRecords();
353 return contactList.count();
354 }
355 else
356 return 0;
357}
358
359
360/**
361 * This method removes all elements from the resource!! (Not from the addressbook)
362 */
363bool ResourceOpie::clear()
364{
365 if (mAccess != 0) {
366 mAccess->clear();
367 return true;
368 }
369 else
370 return false;
371}
372
373
374
375//US #include "resourceopie.moc" 348//US #include "resourceopie.moc"
diff --git a/kabc/plugins/opie/resourceopie.h b/kabc/plugins/opie/resourceopie.h
index ca30fee..d5b4ebd 100644
--- a/kabc/plugins/opie/resourceopie.h
+++ b/kabc/plugins/opie/resourceopie.h
@@ -124,12 +124,2 @@ public:
124 124
125 /**
126 * This method returns the number of elements that are currently in the resource.
127 */
128 virtual int count() const;
129
130 /**
131 * This method removes all elements from the resource!! (Not from the addressbook)
132 */
133 virtual bool clear();
134
135 125
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 4a35f19..242e0c6 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -235,3 +235,7 @@ bool ResourceQtopia::lock( const QString &lockfileName )
235 235
236 if (QFile::exists( lockName )) return false; 236 if (QFile::exists( lockName ))
237 {
238 qDebug("ResourceOpie::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName());
239 return false;
240 }
237 241
@@ -314,45 +318,2 @@ void ResourceQtopia::cleanUp()
314 318
315
316
317/**
318 * This method returns the number of elements that are currently in the resource.
319 */
320int ResourceQtopia::count() const
321{
322 if (mAccess != 0)
323 {
324 int counter = 0;
325 AddressBookIterator it2(*mAccess);
326 for (it2.toFirst(); it2.current(); ++it2) {
327 counter++;
328 }
329
330 return counter;
331 }
332 else
333 return 0;
334}
335
336
337/**
338 * This method removes all elements from the resource!! (Not from the addressbook)
339 */
340bool ResourceQtopia::clear()
341{
342 if (mAccess != 0)
343 {
344 AddressBookIterator it2(*mAccess);
345 for (it2.toFirst(); it2.current(); ++it2) {
346 mAccess->removeContact(*it2.current());
347 }
348 return true;
349 }
350 else
351 return false;
352}
353
354
355
356
357
358//US #include "resourceqtopia.moc" 319//US #include "resourceqtopia.moc"
diff --git a/kabc/plugins/qtopia/resourceqtopia.h b/kabc/plugins/qtopia/resourceqtopia.h
index 90ab1f4..eace280 100644
--- a/kabc/plugins/qtopia/resourceqtopia.h
+++ b/kabc/plugins/qtopia/resourceqtopia.h
@@ -124,12 +124,2 @@ public:
124 124
125 /**
126 * This method returns the number of elements that are currently in the resource.
127 */
128 virtual int count() const;
129
130 /**
131 * This method removes all elements from the resource!! (Not from the addressbook)
132 */
133 virtual bool clear();
134
135protected slots: 125protected slots:
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index 14f272d..70c3718 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -251,3 +251,8 @@ bool ResourceSharpDTM::lock( const QString &lockfileName )
251 251
252 if (QFile::exists( lockName )) return false; 252 if (QFile::exists( lockName ))
253 {
254 qDebug("ResourceSharpDTM::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName());
255 return false;
256 }
257
253 258
@@ -330,25 +335,2 @@ void ResourceSharpDTM::cleanUp()
330 335
331/**
332 * This method returns the number of elements that are currently in the resource.
333 */
334int ResourceSharpDTM::count() const
335{
336 if (mAccess != 0)
337 return mAccess->count();
338 else
339 return 0;
340}
341
342
343/**
344 * This method removes all elements from the resource!! (Not from the addressbook)
345 */
346bool ResourceSharpDTM::clear()
347{
348 if (mAccess != 0)
349 return mAccess->deleteCard(0, SlZDataBase::AllCard );
350 else
351 return false;
352}
353
354 336
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.h b/kabc/plugins/sharpdtm/resourcesharpdtm.h
index 60d38a1..f386e69 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.h
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.h
@@ -124,12 +124,2 @@ public:
124 124
125 /**
126 * This method returns the number of elements that are currently in the resource.
127 */
128 virtual int count() const;
129
130 /**
131 * This method removes all elements from the resource!! (Not from the addressbook)
132 */
133 virtual bool clear();
134
135 125