author | zautrix <zautrix> | 2004-09-11 23:25:03 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 23:25:03 (UTC) |
commit | 0a2900e71fd3d80393d67c81aab3aae19d2d680c (patch) (unidiff) | |
tree | 1f2926eca6bee600819932603eaaf28c7f267d6b /kabc | |
parent | a040c9d56282dae396b02627fafb602e44323837 (diff) | |
download | kdepimpi-0a2900e71fd3d80393d67c81aab3aae19d2d680c.zip kdepimpi-0a2900e71fd3d80393d67c81aab3aae19d2d680c.tar.gz kdepimpi-0a2900e71fd3d80393d67c81aab3aae19d2d680c.tar.bz2 |
Bugfixes
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 32 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 16 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 15 |
3 files changed, 42 insertions, 21 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index fac06a1..7d96cb7 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -61,2 +61,4 @@ $Id$ | |||
61 | 61 | ||
62 | //#define ALLOW_LOCKING | ||
63 | |||
62 | using namespace KABC; | 64 | using namespace KABC; |
@@ -138,12 +140,13 @@ Ticket *ResourceDir::requestSaveTicket() | |||
138 | { | 140 | { |
139 | kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl; | 141 | |
140 | 142 | ||
141 | if ( !addressBook() ) return 0; | 143 | if ( !addressBook() ) return 0; |
142 | 144 | #ifdef ALLOW_LOCKING | |
143 | if ( !lock( mPath ) ) { | 145 | if ( !lock( mPath ) ) { |
144 | kdDebug(5700) << "ResourceDir::requestSaveTicket(): Unable to lock path '" | 146 | |
145 | << mPath << "'" << endl; | ||
146 | return 0; | 147 | return 0; |
147 | } | 148 | } |
149 | #endif | ||
148 | return createTicket( this ); | 150 | return createTicket( this ); |
151 | |||
149 | } | 152 | } |
@@ -180,4 +183,2 @@ bool ResourceDir::load() | |||
180 | { | 183 | { |
181 | kdDebug(5700) << "ResourceDir::load(): '" << mPath << "'" << endl; | ||
182 | |||
183 | QDir dir( mPath ); | 184 | QDir dir( mPath ); |
@@ -207,4 +208,2 @@ bool ResourceDir::save( Ticket *ticket ) | |||
207 | { | 208 | { |
208 | kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl; | ||
209 | |||
210 | AddressBook::Iterator it; | 209 | AddressBook::Iterator it; |
@@ -234,4 +233,5 @@ bool ResourceDir::save( Ticket *ticket ) | |||
234 | delete ticket; | 233 | delete ticket; |
234 | #ifdef ALLOW_LOCKING | ||
235 | unlock( mPath ); | 235 | unlock( mPath ); |
236 | 236 | #endif | |
237 | return ok; | 237 | return ok; |
@@ -241,4 +241,3 @@ bool ResourceDir::lock( const QString &path ) | |||
241 | { | 241 | { |
242 | kdDebug(5700) << "ResourceDir::lock()" << endl; | 242 | #ifdef ALLOW_LOCKING |
243 | |||
244 | QString p = path; | 243 | QString p = path; |
@@ -251,4 +250,2 @@ bool ResourceDir::lock( const QString &path ) | |||
251 | 250 | ||
252 | kdDebug(5700) << "-- lock name: " << lockName << endl; | ||
253 | |||
254 | if ( QFile::exists( lockName ) ) return false; | 251 | if ( QFile::exists( lockName ) ) return false; |
@@ -262,4 +259,2 @@ bool ResourceDir::lock( const QString &path ) | |||
262 | 259 | ||
263 | kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; | ||
264 | |||
265 | // Create unique file | 260 | // Create unique file |
@@ -283,2 +278,5 @@ bool ResourceDir::lock( const QString &path ) | |||
283 | return false; | 278 | return false; |
279 | #else | ||
280 | return true; | ||
281 | #endif | ||
284 | } | 282 | } |
@@ -287,2 +285,3 @@ void ResourceDir::unlock( const QString &path ) | |||
287 | { | 285 | { |
286 | #ifdef ALLOW_LOCKING | ||
288 | QString p = path; | 287 | QString p = path; |
@@ -297,2 +296,5 @@ void ResourceDir::unlock( const QString &path ) | |||
297 | addressBook()->emitAddressBookUnlocked(); | 296 | addressBook()->emitAddressBookUnlocked(); |
297 | #else | ||
298 | return; | ||
299 | #endif | ||
298 | } | 300 | } |
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 | |||
@@ -55,2 +55,3 @@ $Id$ | |||
55 | 55 | ||
56 | //#define ALLOW_LOCKING | ||
56 | 57 | ||
@@ -149,7 +150,8 @@ Ticket *ResourceFile::requestSaveTicket() | |||
149 | 150 | ||
151 | #ifdef ALLOW_LOCKING | ||
150 | if ( !lock( mFileName ) ) { | 152 | if ( !lock( mFileName ) ) { |
151 | kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" | 153 | qDebug("unablt to lock file "); |
152 | << mFileName << "'" << endl; | ||
153 | return 0; | 154 | return 0; |
154 | } | 155 | } |
156 | #endif | ||
155 | return createTicket( this ); | 157 | return createTicket( this ); |
@@ -248,3 +250,5 @@ bool ResourceFile::save( Ticket *ticket ) | |||
248 | delete ticket; | 250 | delete ticket; |
251 | #ifdef ALLOW_LOCKING | ||
249 | unlock( mFileName ); | 252 | unlock( mFileName ); |
253 | #endif | ||
250 | 254 | ||
@@ -255,2 +259,3 @@ bool ResourceFile::lock( const QString &fileName ) | |||
255 | { | 259 | { |
260 | #ifdef ALLOW_LOCKING | ||
256 | 261 | ||
@@ -297,2 +302,5 @@ bool ResourceFile::lock( const QString &fileName ) | |||
297 | return false; | 302 | return false; |
303 | #else | ||
304 | return true; | ||
305 | #endif | ||
298 | } | 306 | } |
@@ -301,2 +309,3 @@ void ResourceFile::unlock( const QString &fileName ) | |||
301 | { | 309 | { |
310 | #ifdef ALLOW_LOCKING | ||
302 | QString fn = fileName; | 311 | QString fn = fileName; |
@@ -312,2 +321,5 @@ void ResourceFile::unlock( const QString &fileName ) | |||
312 | addressBook()->emitAddressBookUnlocked(); | 321 | addressBook()->emitAddressBookUnlocked(); |
322 | #else | ||
323 | return; | ||
324 | #endif | ||
313 | } | 325 | } |
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 | |||
@@ -56,3 +56,3 @@ $Id$ | |||
56 | #include "sharpdtmconverter.h" | 56 | #include "sharpdtmconverter.h" |
57 | 57 | //#define ALLOW_LOCKING | |
58 | using namespace KABC; | 58 | using namespace KABC; |
@@ -107,3 +107,3 @@ Ticket *ResourceSharpDTM::requestSaveTicket() | |||
107 | { | 107 | { |
108 | kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket()" << endl; | 108 | |
109 | 109 | ||
@@ -113,7 +113,8 @@ Ticket *ResourceSharpDTM::requestSaveTicket() | |||
113 | 113 | ||
114 | #ifdef ALLOW_LOCKING | ||
114 | if ( !lock( fileName() ) ) { | 115 | if ( !lock( fileName() ) ) { |
115 | kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket(): Unable to lock file '" | 116 | qDebug("ResourceSharpDTM::requestSaveTicket(): Unable to lock file "); |
116 | << fileName() << "'" << endl; | ||
117 | return 0; | 117 | return 0; |
118 | } | 118 | } |
119 | #endif | ||
119 | return createTicket( this ); | 120 | return createTicket( this ); |
@@ -242,2 +243,3 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) | |||
242 | { | 243 | { |
244 | #ifdef ALLOW_LOCKING | ||
243 | qDebug("ResourceSharpDTM::lock: %s", fileName().latin1()); | 245 | qDebug("ResourceSharpDTM::lock: %s", fileName().latin1()); |
@@ -287,2 +289,5 @@ bool ResourceSharpDTM::lock( const QString &lockfileName ) | |||
287 | return false; | 289 | return false; |
290 | #else | ||
291 | return true; | ||
292 | #endif | ||
288 | } | 293 | } |
@@ -291,2 +296,3 @@ void ResourceSharpDTM::unlock( const QString &fileName ) | |||
291 | { | 296 | { |
297 | #ifdef ALLOW_LOCKING | ||
292 | qDebug("ResourceSharpDTM::unlock() %s", fileName.latin1()); | 298 | qDebug("ResourceSharpDTM::unlock() %s", fileName.latin1()); |
@@ -300,2 +306,3 @@ void ResourceSharpDTM::unlock( const QString &fileName ) | |||
300 | addressBook()->emitAddressBookUnlocked(); | 306 | addressBook()->emitAddressBookUnlocked(); |
307 | #endif | ||
301 | } | 308 | } |