-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 65 |
1 files changed, 50 insertions, 15 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index faa03dc..bd513c0 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -835,5 +835,4 @@ void AdvancedFm::localDelete() }; } - } } @@ -1141,6 +1140,12 @@ void AdvancedFm::copy() for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - QString destFile = currentRemoteDir.canonicalPath()+"/"+(*it); - curFile = currentDir.canonicalPath()+"/"+(*it); + QString destFile = currentRemoteDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); + curFile = currentDir.canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile +=(*it); QFile f(destFile); if( f.exists()) @@ -1155,6 +1160,12 @@ void AdvancedFm::copy() for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - QString destFile = currentDir.canonicalPath()+"/"+(*it); - curFile = currentRemoteDir.canonicalPath()+"/"+(*it); + QString destFile = currentDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); + curFile = currentRemoteDir.canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile +=(*it); QFile f(destFile); if( f.exists()) @@ -1177,6 +1188,9 @@ void AdvancedFm::copyAs() if (TabWidget->currentPageIndex() == 0) { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - QString destFile = *it; - curFile = currentDir.canonicalPath()+"/"+(*it); + QString destFile; + curFile = currentDir.canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile+=(*it); // InputDialog *fileDlg; // fileDlg = new InputDialog(this,tr("Copy As"),TRUE, 0); @@ -1185,5 +1199,8 @@ void AdvancedFm::copyAs() if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); - destFile = currentRemoteDir.canonicalPath()+"/"+destFile; + destFile = currentRemoteDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); QFile f(destFile); @@ -1201,11 +1218,17 @@ void AdvancedFm::copyAs() for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - curFile = currentDir.canonicalPath()+"/"+(*it); - QString destFile = *it; + curFile = currentDir.canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile+=(*it); + QString destFile; fileDlg->setInputText((const QString &) destFile); fileDlg->exec(); if( fileDlg->result() == 1 ) { QString filename = fileDlg->LineEdit1->text(); - destFile = currentDir.canonicalPath()+"/"+destFile; + destFile = currentDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); QFile f(destFile); @@ -1231,7 +1254,13 @@ void AdvancedFm::move() { if (TabWidget->currentPageIndex() == 0) { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - QString destFile = currentRemoteDir.canonicalPath() + "/" + *it; - curFile = currentDir.canonicalPath()+"/"+(*it); + QString destFile = currentRemoteDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); + curFile = currentDir.canonicalPath(); qDebug("Destination file is "+destFile); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile+=(*it); QFile f(destFile); @@ -1247,7 +1276,13 @@ void AdvancedFm::move() { } else { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - QString destFile = currentRemoteDir.canonicalPath() + "/" + *it; + QString destFile = currentRemoteDir.canonicalPath(); + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile +=(*it); qDebug("Destination file is "+destFile); - curFile = currentDir.canonicalPath()+"/"+(*it); + curFile = currentDir.canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile+=(*it); QFile f(destFile); |