summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-08-03 21:19:48 (UTC)
committer ulf69 <ulf69>2004-08-03 21:19:48 (UTC)
commitca9f3d60920d52508238da2099544bb0da1a4ee4 (patch) (unidiff)
tree76011b9cc2741bd6477f4030e5857faf89a50fe9
parentbe52d7d03e57620919b23cb0cbb33ac22d0920e0 (diff)
downloadkdepimpi-ca9f3d60920d52508238da2099544bb0da1a4ee4.zip
kdepimpi-ca9f3d60920d52508238da2099544bb0da1a4ee4.tar.gz
kdepimpi-ca9f3d60920d52508238da2099544bb0da1a4ee4.tar.bz2
cleanup of debug code
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 242e0c6..5565580 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -214,49 +214,49 @@ bool ResourceQtopia::save( Ticket *ticket )
214 214
215// mAccess->addressBookUpdated(); 215// mAccess->addressBookUpdated();
216 216
217 delete ticket; 217 delete ticket;
218 unlock( fileName() ); 218 unlock( fileName() );
219 219
220 return true; 220 return true;
221} 221}
222 222
223bool ResourceQtopia::lock( const QString &lockfileName ) 223bool ResourceQtopia::lock( const QString &lockfileName )
224{ 224{
225 qDebug("ResourceQtopia::lock: %s", fileName().latin1()); 225 qDebug("ResourceQtopia::lock: %s", fileName().latin1());
226 226
227 kdDebug(5700) << "ResourceQtopia::lock()" << endl; 227 kdDebug(5700) << "ResourceQtopia::lock()" << endl;
228 228
229 QString fn = lockfileName; 229 QString fn = lockfileName;
230 230
231 KURL url(fn); 231 KURL url(fn);
232 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 232 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
233 233
234 kdDebug(5700) << "-- lock name: " << lockName << endl; 234 kdDebug(5700) << "-- lock name: " << lockName << endl;
235 235
236 if (QFile::exists( lockName )) 236 if (QFile::exists( lockName ))
237 { 237 {
238 qDebug("ResourceOpie::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName()); 238 qDebug("ResourceOpie::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName().latin1());
239 return false; 239 return false;
240 } 240 }
241 241
242 QString lockUniqueName; 242 QString lockUniqueName;
243 lockUniqueName = fn + KApplication::randomString( 8 ); 243 lockUniqueName = fn + KApplication::randomString( 8 );
244 244
245 url = lockUniqueName; 245 url = lockUniqueName;
246//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 246//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
247 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 247 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
248 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; 248 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
249 249
250 // Create unique file 250 // Create unique file
251 QFile file( mLockUniqueName ); 251 QFile file( mLockUniqueName );
252 file.open( IO_WriteOnly ); 252 file.open( IO_WriteOnly );
253 file.close(); 253 file.close();
254 254
255 // Create lock file 255 // Create lock file
256 int result = 0; 256 int result = 0;
257#ifndef _WIN32_ 257#ifndef _WIN32_
258 result = ::link( QFile::encodeName( mLockUniqueName ), 258 result = ::link( QFile::encodeName( mLockUniqueName ),
259 QFile::encodeName( lockName ) ); 259 QFile::encodeName( lockName ) );
260#endif 260#endif
261 if ( result == 0 ) { 261 if ( result == 0 ) {
262 addressBook()->emitAddressBookLocked(); 262 addressBook()->emitAddressBookLocked();