-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index b5a05d3..f14f588 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -470,26 +470,33 @@ void AdvancedFm::move() { moveDirectory( curFile, destFile ); rePopulate(); return; } - QFile f( curFile); + QFile f( destFile); if( f.exists()) { + switch ( QMessageBox::warning(this,tr("File Exists!"), + tr("<p>%1 already exists. Ok to overwrite?</P>").arg(destFile), + tr("Yes"),tr("No"),0,0,1)) { + case 1: + return; + break; + }; if( !copyFile( curFile, destFile) ) { - QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); + QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg(curFile)); return; } else QFile::remove(curFile); } } - } rePopulate(); // setOtherTabCurrent(); } bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { int err = 0; - if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src; + if( copyDirectory( src, dest ) ) { + QString cmd = "rm -rf " + src; err = system((const char*)cmd); } else err = -1; @@ -505,10 +512,9 @@ bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { QString cmd = "/bin/cp -fpR " + src + " " + dest; owarn << cmd << oendl; int err = system( (const char *) cmd ); if ( err != 0 ) { - QMessageBox::message("AdvancedFm", - tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); + QMessageBox::message("AdvancedFm", tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); return false; } return true; |