summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-09-25 05:50:48 (UTC)
committer llornkcor <llornkcor>2004-09-25 05:50:48 (UTC)
commitdba0864dd99dfc86a33bde72809634be7f0da9c4 (patch) (side-by-side diff)
tree074ccc67cc4e7474d697117357bca2c1b19cef16
parent244945237bc55945ba41f86d5f175204e00592ea (diff)
downloadopie-dba0864dd99dfc86a33bde72809634be7f0da9c4.zip
opie-dba0864dd99dfc86a33bde72809634be7f0da9c4.tar.gz
opie-dba0864dd99dfc86a33bde72809634be7f0da9c4.tar.bz2
fix move overwrite
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp18
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
@@ -473,6 +473,13 @@ void AdvancedFm::move() {
}
- 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;
@@ -482,3 +489,2 @@ void AdvancedFm::move() {
}
-
}
@@ -490,3 +496,4 @@ 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);
@@ -508,4 +515,3 @@ bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
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;