summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -469,61 +469,63 @@ void AdvancedFm::move() {
item=(*it);
QString destFile = thatDir->canonicalPath();
if(destFile.right(1).find("/",0,TRUE) == -1)
destFile+="/";
destFile += item;
// odebug << "Destination file is "+destFile << oendl;
curFile = thisDir->canonicalPath();
if(curFile.right(1).find("/",0,TRUE) == -1)
curFile +="/";
curFile+= item;
// odebug << "CurrentFile file is " + curFile << oendl;
if(QFileInfo(curFile).isDir()) {
moveDirectory( curFile, destFile );
rePopulate();
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 0:
+ break;
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
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;
err = system((const char*)cmd);
} else
err = -1;
if(err!=0) {
QMessageBox::message(tr("Note"),tr("<p>Could not move %1</p>").arg( src));
return false;
}
return true;
}
bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
QString cmd = "/bin/cp -fpR " + src + " " + dest;