From 7a75a5dc83cf0899958a24cb28d3b32f6f42933e Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 1 Oct 2016 15:10:32 +0200 Subject: Remove source torrent if it already exists in dest Don't care if it's the same file... --- torrentwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'torrentwidget.cpp') 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())); -- cgit v1.2.3-70-g09d2