-rw-r--r-- | library/filemanager.cpp | 4 |
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 | |||
@@ -304,33 +304,33 @@ bool FileManager::copyFile( const QString & src, const QString & dest ) { | |||
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 | ||
311 | bool FileManager::renameFile( const QString & src, const QString & dest ) { | 311 | bool 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 | /* | |
321 | bool FileManager::copyFile( const QString & src, const QString & dest ) { | 321 | bool 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); |
@@ -364,33 +364,33 @@ bool FileManager::copyFile( const QString & src, const QString & dest ) { | |||
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 | ||
372 | bool FileManager::renameFile( const QString & src, const QString & dest ) { | 372 | bool 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 | */ |
388 | QIODevice* FileManager::openFile( const DocLnk& f ) | 388 | QIODevice* 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; |