-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index 8a795e9..867bc07 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp @@ -54,7 +54,7 @@ $Id$ #include "stdaddressbook.h" #include "sharpdtmconverter.h" - +//#define ALLOW_LOCKING using namespace KABC; extern "C" { @@ -105,17 +105,18 @@ void ResourceSharpDTM::writeConfig( KConfig *config ) Ticket *ResourceSharpDTM::requestSaveTicket() { - kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket()" << endl; + qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1()); if ( !addressBook() ) return 0; +#ifdef ALLOW_LOCKING if ( !lock( fileName() ) ) { - kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket(): Unable to lock file '" - << fileName() << "'" << endl; + qDebug("ResourceSharpDTM::requestSaveTicket(): Unable to lock file "); return 0; } +#endif return createTicket( this ); } @@ -240,6 +241,7 @@ bool ResourceSharpDTM::save( Ticket *ticket ) bool ResourceSharpDTM::lock( const QString &lockfileName ) { +#ifdef ALLOW_LOCKING qDebug("ResourceSharpDTM::lock: %s", fileName().latin1()); kdDebug(5700) << "ResourceSharpDTM::lock()" << endl; @@ -285,10 +287,14 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) // TODO: check stat return false; +#else + return true; +#endif } void ResourceSharpDTM::unlock( const QString &fileName ) { +#ifdef ALLOW_LOCKING qDebug("ResourceSharpDTM::unlock() %s", fileName.latin1()); QString fn = fileName; @@ -298,6 +304,7 @@ void ResourceSharpDTM::unlock( const QString &fileName ) QFile::remove( lockName ); QFile::remove( mLockUniqueName ); addressBook()->emitAddressBookUnlocked(); +#endif } void ResourceSharpDTM::setFileName( const QString &newFileName ) |