From 0a2900e71fd3d80393d67c81aab3aae19d2d680c Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 11 Sep 2004 23:25:03 +0000 Subject: Bugfixes --- (limited to 'kabc/plugins/file/resourcefile.cpp') diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index fa6bc49..17263ae 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -53,6 +53,7 @@ $Id$ #include "resourcefile.h" #include "syncprefwidget.h" +//#define ALLOW_LOCKING using namespace KABC; @@ -147,11 +148,12 @@ Ticket *ResourceFile::requestSaveTicket() if ( !addressBook() ) return 0; +#ifdef ALLOW_LOCKING if ( !lock( mFileName ) ) { - kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" - << mFileName << "'" << endl; + qDebug("unablt to lock file "); return 0; } +#endif return createTicket( this ); } @@ -246,13 +248,16 @@ bool ResourceFile::save( Ticket *ticket ) mDirWatch.startScan(); delete ticket; +#ifdef ALLOW_LOCKING unlock( mFileName ); +#endif return ok; } bool ResourceFile::lock( const QString &fileName ) { +#ifdef ALLOW_LOCKING QString fn = fileName; @@ -295,10 +300,14 @@ bool ResourceFile::lock( const QString &fileName ) // TODO: check stat return false; +#else + return true; +#endif } void ResourceFile::unlock( const QString &fileName ) { +#ifdef ALLOW_LOCKING QString fn = fileName; //US change the implementation how the lockfilename is getting created //US fn.replace( QRegExp( "/" ), "_" ); @@ -310,6 +319,9 @@ void ResourceFile::unlock( const QString &fileName ) QFile::remove( lockName ); QFile::remove( mLockUniqueName ); addressBook()->emitAddressBookUnlocked(); +#else + return; +#endif } void ResourceFile::setFileName( const QString &fileName ) -- cgit v0.9.0.2