summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-10-13 21:53:13 (UTC)
committer llornkcor <llornkcor>2004-10-13 21:53:13 (UTC)
commit1f59ac9b59393b46a7ae5d4e1a46e1c1aaf05b23 (patch) (unidiff)
tree85461425e52ee7e90b40ffeaed7450122a8cb0b0
parentff1e5cf77abe865c4ca9beda114577ad4a13e61f (diff)
downloadopie-1f59ac9b59393b46a7ae5d4e1a46e1c1aaf05b23.zip
opie-1f59ac9b59393b46a7ae5d4e1a46e1c1aaf05b23.tar.gz
opie-1f59ac9b59393b46a7ae5d4e1a46e1c1aaf05b23.tar.bz2
fix move
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index f25048a..8b98898 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -477,45 +477,47 @@ void AdvancedFm::move() {
477 curFile = thisDir->canonicalPath(); 477 curFile = thisDir->canonicalPath();
478 if(curFile.right(1).find("/",0,TRUE) == -1) 478 if(curFile.right(1).find("/",0,TRUE) == -1)
479 curFile +="/"; 479 curFile +="/";
480 curFile+= item; 480 curFile+= item;
481// odebug << "CurrentFile file is " + curFile << oendl; 481// odebug << "CurrentFile file is " + curFile << oendl;
482 482
483 if(QFileInfo(curFile).isDir()) { 483 if(QFileInfo(curFile).isDir()) {
484 moveDirectory( curFile, destFile ); 484 moveDirectory( curFile, destFile );
485 rePopulate(); 485 rePopulate();
486 return; 486 return;
487 } 487 }
488 QFile f( destFile); 488 QFile f( destFile);
489 if( f.exists()) { 489 if( f.exists()) {
490 switch ( QMessageBox::warning(this,tr("File Exists!"), 490 switch ( QMessageBox::warning(this,tr("File Exists!"),
491 tr("<p>%1 already exists. Ok to overwrite?</P>").arg(destFile), 491 tr("<p>%1 already exists. Ok to overwrite?</P>").arg(destFile),
492 tr("Yes"),tr("No"),0,0,1)) { 492 tr("Yes"),tr("No"),0,0,1)) {
493 case 0:
494 break;
493 case 1: 495 case 1:
494 return; 496 return;
495 break; 497 break;
496 default: 498 default:
497 return; 499 return;
498 break; 500 break;
499 }; 501 };
502 }
500 if( !copyFile( curFile, destFile) ) { 503 if( !copyFile( curFile, destFile) ) {
501 QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg(curFile)); 504 QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg(curFile));
502 return; 505 return;
503 } else 506 } else
504 QFile::remove(curFile); 507 QFile::remove(curFile);
505 }
506 } 508 }
507 } 509 }
508 rePopulate(); 510 rePopulate();
509 //setOtherTabCurrent(); 511 //setOtherTabCurrent();
510} 512}
511 513
512bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { 514bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
513 int err = 0; 515 int err = 0;
514 if( copyDirectory( src, dest ) ) { 516 if( copyDirectory( src, dest ) ) {
515 QString cmd = "rm -rf " + src; 517 QString cmd = "rm -rf " + src;
516 err = system((const char*)cmd); 518 err = system((const char*)cmd);
517 } else 519 } else
518 err = -1; 520 err = -1;
519 521
520 if(err!=0) { 522 if(err!=0) {
521 QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg( src)); 523 QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg( src));