summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/opie
Unidiff
Diffstat (limited to 'kabc/plugins/opie') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp39
-rw-r--r--kabc/plugins/opie/resourceopie.h10
2 files changed, 6 insertions, 43 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
@@ -87,6 +87,7 @@ ResourceOpie::ResourceOpie( const QString &fileName, bool syncable )
87 87
88void ResourceOpie::init( const QString &fileName ) 88void ResourceOpie::init( const QString &fileName )
89{ 89{
90 qDebug("ResourceOpie::init()");
90 91
91 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 92 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
92 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 93 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
@@ -254,7 +255,11 @@ bool ResourceOpie::lock( const QString &lockfileName )
254 255
255 kdDebug(5700) << "-- lock name: " << lockName << endl; 256 kdDebug(5700) << "-- lock name: " << lockName << endl;
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
259 QString lockUniqueName; 264 QString lockUniqueName;
260 lockUniqueName = fn + KApplication::randomString( 8 ); 265 lockUniqueName = fn + KApplication::randomString( 8 );
@@ -340,36 +345,4 @@ void ResourceOpie::cleanUp()
340} 345}
341 346
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
@@ -122,16 +122,6 @@ public:
122 */ 122 */
123 virtual void cleanUp(); 123 virtual void cleanUp();
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
136protected slots: 126protected slots:
137 void fileChanged(); 127 void fileChanged();