summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-10-01 15:10:32 +0200
committerArno <arno@disconnect.de>2016-10-01 15:10:32 +0200
commit7a75a5dc83cf0899958a24cb28d3b32f6f42933e (patch)
treea004b8217a1068c01c27d2a105848f2f0fdee53b
parent3bdf9e931dce450f477151d92f7dd8a2171d2224 (diff)
downloadShemovCleaner-7a75a5dc83cf0899958a24cb28d3b32f6f42933e.tar.gz
ShemovCleaner-7a75a5dc83cf0899958a24cb28d3b32f6f42933e.tar.bz2
ShemovCleaner-7a75a5dc83cf0899958a24cb28d3b32f6f42933e.zip
Remove source torrent if it already exists in dest
Don't care if it's the same file...
-rw-r--r--torrentwidget.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp
index 9b155cf..e86b3e9 100644
--- a/torrentwidget.cpp
+++ b/torrentwidget.cpp
@@ -258,6 +258,13 @@ void TorrentWidget::moveFiles(){
bool ok = QFile::rename(fp.absoluteFilePath(), newfn);
if(ok){
++ctr;
+ }else{
+ QFileInfo nf(newfn);
+ if(nf.exists() && nf.isFile()){
+ //don't care if it's the same file or not...
+ QFile::remove(fp.absoluteFilePath());
+ ++ctr;
+ }
}
}
QString msg = QString(tr("Successfully moved %1 of %2 file(s)")).arg(QString::number(ctr)).arg(QString::number(sel.count()));