summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir/resourcedir.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 3cb5179..7825c6f 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -103,29 +103,27 @@ ResourceDir::ResourceDir( const KConfig *config )
103 } 103 }
104 104
105/*US 105/*US
106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); 106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
107 if (mFormatName == "vcard") 107 if (mFormatName == "vcard")
108 mFormat = new VCardFormatPlugin2(); 108 mFormat = new VCardFormatPlugin2();
109 else if (mFormatName == "binary") 109 else if (mFormatName == "binary")
110 mFormat = new BinaryFormat(); 110 mFormat = new BinaryFormat();
111 else 111 else
112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); 112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
113*/ 113*/
114 114
115/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
116 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
117 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); 116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
118 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); 117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
119*/
120 118
121 setPath( path ); 119 setPath( path );
122} 120}
123 121
124ResourceDir::~ResourceDir() 122ResourceDir::~ResourceDir()
125{ 123{
126 delete mFormat; 124 delete mFormat;
127 mFormat = 0; 125 mFormat = 0;
128} 126}
129 127
130void ResourceDir::writeConfig( KConfig *config ) 128void ResourceDir::writeConfig( KConfig *config )
131{ 129{
@@ -289,37 +287,34 @@ void ResourceDir::unlock( const QString &path )
289//US p.replace( QRegExp( "/" ), "_" ); 287//US p.replace( QRegExp( "/" ), "_" );
290//US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" ); 288//US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" );
291 KURL url(p); 289 KURL url(p);
292 QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" ); 290 QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" );
293 291
294 ::unlink( QFile::encodeName( lockName ) ); 292 ::unlink( QFile::encodeName( lockName ) );
295 QFile::remove( mLockUniqueName ); 293 QFile::remove( mLockUniqueName );
296 addressBook()->emitAddressBookUnlocked(); 294 addressBook()->emitAddressBookUnlocked();
297} 295}
298 296
299void ResourceDir::setPath( const QString &path ) 297void ResourceDir::setPath( const QString &path )
300{ 298{
301/*US ToDo: no synchronization so far. Has to be changed in the future
302 mDirWatch.stopScan(); 299 mDirWatch.stopScan();
303 mDirWatch.removeDir( mPath ); 300 mDirWatch.removeDir( mPath );
304*/ 301
305 mPath = path; 302 mPath = path;
306 303
307/*US ToDo: no synchronization so far. Has to be changed in the future
308 mDirWatch.addDir( mPath, true ); 304 mDirWatch.addDir( mPath, true );
309 mDirWatch.startScan(); 305 mDirWatch.startScan();
310*/
311 306
312//US simulate KDirWatch event 307//US simulate KDirWatch event
313 pathChanged(); 308//US pathChanged();
314 309
315} 310}
316 311
317QString ResourceDir::path() const 312QString ResourceDir::path() const
318{ 313{
319 return mPath; 314 return mPath;
320} 315}
321 316
322void ResourceDir::setFormat( const QString &format ) 317void ResourceDir::setFormat( const QString &format )
323{ 318{
324 mFormatName = format; 319 mFormatName = format;
325 320