summaryrefslogtreecommitdiff
authorwaspe <waspe>2003-11-05 18:34:52 (UTC)
committer waspe <waspe>2003-11-05 18:34:52 (UTC)
commitb7669e25027e64a721705548efc2a7f92daed704 (patch) (unidiff)
tree7bbb2a807f57e41896fe304b963d024eb22d5c7b
parent7f271d89922254226280f039ae53c5fee63ef94d (diff)
downloadopie-b7669e25027e64a721705548efc2a7f92daed704.zip
opie-b7669e25027e64a721705548efc2a7f92daed704.tar.gz
opie-b7669e25027e64a721705548efc2a7f92daed704.tar.bz2
double entries in function defintions
(i commented out the second entry)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/filemanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/filemanager.cpp b/library/filemanager.cpp
index c51ca2f..eff8429 100644
--- a/library/filemanager.cpp
+++ b/library/filemanager.cpp
@@ -296,49 +296,49 @@ bool FileManager::copyFile( const QString & src, const QString & dest ) {
296 } else { 296 } else {
297 qWarning("open read failed %s, %s",src.latin1(), dest.latin1()); 297 qWarning("open read failed %s, %s",src.latin1(), dest.latin1());
298 success = false; 298 success = false;
299 } 299 }
300 srcFile.close(); 300 srcFile.close();
301 destFile.close(); 301 destFile.close();
302 // Set file permissions 302 // Set file permissions
303 if( stat( (const char *) src, &status ) == 0 ) { 303 if( stat( (const char *) src, &status ) == 0 ) {
304 chmod( (const char *) dest, status.st_mode ); 304 chmod( (const char *) dest, status.st_mode );
305 } 305 }
306 306
307 return success; 307 return success;
308} 308}
309 309
310 310
311bool FileManager::renameFile( const QString & src, const QString & dest ) { 311bool FileManager::renameFile( const QString & src, const QString & dest ) {
312 if(copyFile( src, dest )) { 312 if(copyFile( src, dest )) {
313 if(QFile::remove(src) ) { 313 if(QFile::remove(src) ) {
314 return true; 314 return true;
315 } 315 }
316 } 316 }
317 return false; 317 return false;
318} 318}
319 319
320 320/*
321bool FileManager::copyFile( const QString & src, const QString & dest ) { 321bool FileManager::copyFile( const QString & src, const QString & dest ) {
322 bool success = true; 322 bool success = true;
323 struct stat status; 323 struct stat status;
324 int read_fd=0; 324 int read_fd=0;
325 int write_fd=0; 325 int write_fd=0;
326 struct stat stat_buf; 326 struct stat stat_buf;
327 off_t offset = 0; 327 off_t offset = 0;
328 QFile srcFile(src); 328 QFile srcFile(src);
329 QFile destFile(dest); 329 QFile destFile(dest);
330 330
331 if(!srcFile.open( IO_ReadOnly|IO_Raw)) { 331 if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
332 return success = false; 332 return success = false;
333 } 333 }
334 read_fd = srcFile.handle(); 334 read_fd = srcFile.handle();
335 if(read_fd != -1) { 335 if(read_fd != -1) {
336 fstat (read_fd, &stat_buf); 336 fstat (read_fd, &stat_buf);
337 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) 337 if( !destFile.open( IO_WriteOnly|IO_Raw ) )
338 return success = false; 338 return success = false;
339 write_fd = destFile.handle(); 339 write_fd = destFile.handle();
340 if(write_fd != -1) { 340 if(write_fd != -1) {
341 int err=0; 341 int err=0;
342 QString msg; 342 QString msg;
343 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); 343 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size);
344 if( err == -1) { 344 if( err == -1) {
@@ -356,49 +356,49 @@ bool FileManager::copyFile( const QString & src, const QString & dest ) {
356 } 356 }
357 } else { 357 } else {
358 qWarning("open read failed %s, %s",src.latin1(), dest.latin1()); 358 qWarning("open read failed %s, %s",src.latin1(), dest.latin1());
359 success = false; 359 success = false;
360 } 360 }
361 srcFile.close(); 361 srcFile.close();
362 destFile.close(); 362 destFile.close();
363 // Set file permissions 363 // Set file permissions
364 if( stat( (const char *) src, &status ) == 0 ) { 364 if( stat( (const char *) src, &status ) == 0 ) {
365 chmod( (const char *) dest, status.st_mode ); 365 chmod( (const char *) dest, status.st_mode );
366 } 366 }
367 367
368 return success; 368 return success;
369} 369}
370 370
371 371
372bool FileManager::renameFile( const QString & src, const QString & dest ) { 372bool FileManager::renameFile( const QString & src, const QString & dest ) {
373 if(copyFile( src, dest )) { 373 if(copyFile( src, dest )) {
374 if(QFile::remove(src) ) { 374 if(QFile::remove(src) ) {
375 return true; 375 return true;
376 } 376 }
377 } 377 }
378 return false; 378 return false;
379} 379}
380 380*/
381 381
382/*! 382/*!
383 Opens the document specified by \a f as a readable QIODevice. 383 Opens the document specified by \a f as a readable QIODevice.
384 The caller must delete the return value. 384 The caller must delete the return value.
385 385
386 Returns 0 if the operation fails. 386 Returns 0 if the operation fails.
387*/ 387*/
388QIODevice* FileManager::openFile( const DocLnk& f ) 388QIODevice* FileManager::openFile( const DocLnk& f )
389{ 389{
390 QString fn = f.file(); 390 QString fn = f.file();
391 QFile* fl = new QFile( fn ); 391 QFile* fl = new QFile( fn );
392 if ( !fl->open( IO_ReadOnly ) ) { 392 if ( !fl->open( IO_ReadOnly ) ) {
393 delete fl; 393 delete fl;
394 fl = 0; 394 fl = 0;
395 } 395 }
396 return fl; 396 return fl;
397} 397}
398 398
399/*! 399/*!
400 Opens the document specified by \a f as a writable QIODevice. 400 Opens the document specified by \a f as a writable QIODevice.
401 The caller must delete the return value. 401 The caller must delete the return value.
402 402
403 Returns 0 if the operation fails. 403 Returns 0 if the operation fails.
404*/ 404*/