-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 137 |
1 files changed, 80 insertions, 57 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 4802771..f25048a 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -156,8 +156,11 @@ void AdvancedFm::doDelete() { break; case 1: return; break; + default: + return; + break; }; } QString myFile; @@ -177,29 +180,34 @@ void AdvancedFm::doDelete() { switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("<p>Really delete %1 and all it's contents?</p>" ).arg( f ) , tr("Yes"), tr("No"), 0, 0, 1) ) { case 0: - { - f=f.left(f.length()-1); - QString cmd="rm -rf "+f; - startProcess( (const QString)cmd.latin1() ); - populateView(); - } - break; + { + f=f.left(f.length()-1); + QString cmd="rm -rf "+f; + startProcess( (const QString)cmd.latin1() ); + populateView(); + } + break; case 1: - // exit - break; + // exit + break; + default: + break; }; } else { if(doMsg) { - switch ( QMessageBox::warning(this,tr("Delete"), - tr("<p>Really delete %1?</p>").arg( myFile ), - tr("Yes"), tr("No"), 0, 0, 1) ) { - case 1: - return; - break; - }; + switch ( QMessageBox::warning(this,tr("Delete"), + tr("<p>Really delete %1?</p>").arg( myFile ), + tr("Yes"), tr("No"), 0, 0, 1) ) { + case 1: + return; + break; + default: + return; + break; + }; } QString cmd="rm "+f; QFile file(f); @@ -283,14 +291,17 @@ void AdvancedFm::copy() { msg=tr("<p>Really copy %1 files?</p>").arg(count); switch ( QMessageBox::warning(this,tr("Copy"),msg ,tr("Yes"),tr("No"),0,0,1) ) { - case 0: - doMsg=false; - break; - case 1: - return; - break; + case 0: + doMsg=false; + break; + case 1: + return; + break; + default: + return; + break; }; } QString curFile, item, destFile; @@ -307,15 +318,18 @@ void AdvancedFm::copy() { QFile f(destFile); if( f.exists()) { if(doMsg) { - switch ( QMessageBox::warning(this,tr("File Exists!"), - tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), - tr("Yes"),tr("No"),0,0,1)) { - case 1: - return; - break; - }; + switch ( QMessageBox::warning(this,tr("File Exists!"), + tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), + tr("Yes"),tr("No"),0,0,1)) { + case 1: + return; + break; + default: + return; + break; + }; } f.remove(); } @@ -356,18 +370,21 @@ void AdvancedFm::copyAs() { destFile = thatDir->canonicalPath()+"/"+filename; QFile f( destFile); if( f.exists()) { - switch (QMessageBox::warning(this,tr("File Exists!"), - tr("<P> %1 already exists. Ok to overwrite?</p>").arg(item), - tr("Yes"),tr("No"),0,0,1) ) { - case 0: - f.remove(); - break; - case 1: - return; - break; - }; + switch (QMessageBox::warning(this,tr("File Exists!"), + tr("<P> %1 already exists. Ok to overwrite?</p>").arg(item), + tr("Yes"),tr("No"),0,0,1) ) { + case 0: + f.remove(); + break; + case 1: + return; + break; + default: + return; + break; + }; } if( !copyFile( curFile, destFile) ) { QMessageBox::message("AdvancedFm",tr("<p>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); return; @@ -408,19 +425,22 @@ void AdvancedFm::copySameDir() { destFile = thisDir->canonicalPath()+"/"+filename; QFile f(destFile); if( f.exists()) { - switch (QMessageBox::warning(this,tr("Delete"), - tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), - tr("Yes"),tr("No"),0,0,1) ) { - case 0: - - f.remove(); - break; - case 1: - return; - break; - }; + switch (QMessageBox::warning(this,tr("Delete"), + tr("<p> %1 already exists. Do you really want to delete it?</P>").arg(destFile), + tr("Yes"),tr("No"),0,0,1) ) { + case 0: + + f.remove(); + break; + case 1: + return; + break; + default: + return; + break; + }; } if(!copyFile( curFile,destFile) ) { QMessageBox::message("AdvancedFm",tr("<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); return; @@ -466,15 +486,18 @@ void AdvancedFm::move() { return; } 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; - }; + 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; + default: + return; + break; + }; if( !copyFile( curFile, destFile) ) { QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg(curFile)); return; } else |