summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/opie
authorulf69 <ulf69>2004-08-02 23:23:36 (UTC)
committer ulf69 <ulf69>2004-08-02 23:23:36 (UTC)
commitd5358380edce9a2c39f3eea4df741a148338880c (patch) (unidiff)
tree8f514a5e200ecfa3c5f4256d85606ade7c6b3093 /kabc/plugins/opie
parent464ed9d13592965a63b614a1f2902000eb26f1ae (diff)
downloadkdepimpi-d5358380edce9a2c39f3eea4df741a148338880c.zip
kdepimpi-d5358380edce9a2c39f3eea4df741a148338880c.tar.gz
kdepimpi-d5358380edce9a2c39f3eea4df741a148338880c.tar.bz2
changes that resources support writing and syncing
Diffstat (limited to 'kabc/plugins/opie') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 1222242..5559827 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -50,7 +50,7 @@ $Id$
50 50
51#include "resourceopieconfig.h" 51#include "resourceopieconfig.h"
52#include "stdaddressbook.h" 52#include "stdaddressbook.h"
53#include "syncwidget.h" 53#include "syncprefwidget.h"
54 54
55#include "opieconverter.h" 55#include "opieconverter.h"
56 56
@@ -61,7 +61,7 @@ extern "C"
61{ 61{
62 void *init_microkabc_opie() 62 void *init_microkabc_opie()
63 { 63 {
64 return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, KRES::SyncWidget>(); 64 return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, SyncPrefWidget>();
65 } 65 }
66} 66}
67 67
@@ -76,15 +76,12 @@ ResourceOpie::ResourceOpie( const KConfig *config, bool syncable )
76 76
77 } 77 }
78 78
79// qDebug("ResourceOpie::ResourceOpie : %s", fileName.latin1() );
80
81 init( fileName ); 79 init( fileName );
82} 80}
83 81
84ResourceOpie::ResourceOpie( const QString &fileName, bool syncable ) 82ResourceOpie::ResourceOpie( const QString &fileName, bool syncable )
85 : Resource( 0, syncable ) 83 : Resource( 0, syncable )
86{ 84{
87// qDebug("ResourceOpie::ResourceOpie : 3 %s", fileName.latin1());
88 init( fileName ); 85 init( fileName );
89} 86}
90 87
@@ -95,9 +92,7 @@ void ResourceOpie::init( const QString &fileName )
95 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 92 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
96 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 93 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
97 94
98
99 setFileName( fileName ); 95 setFileName( fileName );
100
101} 96}
102 97
103ResourceOpie::~ResourceOpie() 98ResourceOpie::~ResourceOpie()
@@ -107,7 +102,6 @@ ResourceOpie::~ResourceOpie()
107 102
108 if(mAccess != 0) 103 if(mAccess != 0)
109 delete mAccess; 104 delete mAccess;
110
111} 105}
112 106
113void ResourceOpie::writeConfig( KConfig *config ) 107void ResourceOpie::writeConfig( KConfig *config )
@@ -251,16 +245,10 @@ bool ResourceOpie::lock( const QString &lockfileName )
251{ 245{
252 qDebug("ResourceOpie::lock: %s", fileName().latin1()); 246 qDebug("ResourceOpie::lock: %s", fileName().latin1());
253 247
254
255// qDebug("ResourceOpie::lock() %s", fileName.latin1());
256 kdDebug(5700) << "ResourceOpie::lock()" << endl; 248 kdDebug(5700) << "ResourceOpie::lock()" << endl;
257 249
258 QString fn = lockfileName; 250 QString fn = lockfileName;
259 251
260//US change the implementation how the lockfilename is getting created
261//US fn.replace( QRegExp("/"), "_" );
262//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
263
264 KURL url(fn); 252 KURL url(fn);
265 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 253 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
266 254
@@ -302,10 +290,6 @@ void ResourceOpie::unlock( const QString &fileName )
302 qDebug("ResourceOpie::unlock() %s", fileName.latin1()); 290 qDebug("ResourceOpie::unlock() %s", fileName.latin1());
303 291
304 QString fn = fileName; 292 QString fn = fileName;
305//US change the implementation how the lockfilename is getting created
306//US fn.replace( QRegExp( "/" ), "_" );
307//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
308//US QString lockName = fn + ".lock";
309 KURL url(fn); 293 KURL url(fn);
310 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 294 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
311 295