-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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 @@ -54,4 +54,5 @@ $Id$ #include "syncprefwidget.h" +//#define ALLOW_LOCKING using namespace KABC; @@ -148,9 +149,10 @@ 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 ); } @@ -247,5 +249,7 @@ bool ResourceFile::save( Ticket *ticket ) delete ticket; +#ifdef ALLOW_LOCKING unlock( mFileName ); +#endif return ok; @@ -254,4 +258,5 @@ bool ResourceFile::save( Ticket *ticket ) bool ResourceFile::lock( const QString &fileName ) { +#ifdef ALLOW_LOCKING @@ -296,8 +301,12 @@ bool ResourceFile::lock( const QString &fileName ) 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 @@ -311,4 +320,7 @@ void ResourceFile::unlock( const QString &fileName ) QFile::remove( mLockUniqueName ); addressBook()->emitAddressBookUnlocked(); +#else + return; +#endif } |