From 0d3c6707287dd5dda41cb76f85c4c87e7a133bb1 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 30 Mar 2017 10:06:09 +0800 Subject: [PATCH 1/3] Add log message --- src/gui/transferlistwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 7bc8a5f51..b9c85849b 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -46,6 +46,7 @@ #include "transferlistwidget.h" #include "base/bittorrent/session.h" #include "base/bittorrent/torrenthandle.h" +#include "base/logger.h" #include "base/torrentfilter.h" #include "transferlistdelegate.h" #include "previewselect.h" @@ -260,8 +261,10 @@ void TransferListWidget::setSelectedTorrentsLocation() qDebug("New location is %s", qPrintable(newLocation)); // Actually move storage - foreach (BitTorrent::TorrentHandle *const torrent, torrents) + foreach (BitTorrent::TorrentHandle *const torrent, torrents) { + Logger::instance()->addMessage(tr("Set location: moving \"%1\", from \"%2\" to \"%3\"", "Set location: moving \"ubuntu_16_04.iso\", from \"/home/dir1\" to \"/home/dir2\"").arg(torrent->name()).arg(torrent->savePath()).arg(newLocation)); torrent->move(Utils::Fs::expandPathAbs(newLocation)); + } } void TransferListWidget::pauseAllTorrents() From faaafce35b0fe602b9cbb076ec292a0757e571fd Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 30 Mar 2017 10:14:33 +0800 Subject: [PATCH 2/3] Fix cancel "Set location" causes files move to installation dir. Closes #6568. --- src/gui/transferlistwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index b9c85849b..8330c7e74 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -257,7 +257,7 @@ void TransferListWidget::setSelectedTorrentsLocation() const QString newLocation = QFileDialog::getExistingDirectory(this, tr("Choose save path"), oldLocation, QFileDialog::DontConfirmOverwrite | QFileDialog::ShowDirsOnly | QFileDialog::HideNameFilterDetails); - if (!QDir(newLocation).exists()) return; + if (newLocation.isEmpty() || !QDir(newLocation).exists()) return; qDebug("New location is %s", qPrintable(newLocation)); // Actually move storage From 5de505acfea879e38fc7e4c876f1f387ef457f44 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 30 Mar 2017 10:17:39 +0800 Subject: [PATCH 3/3] Cleanup headers Remove unused headers Sort header includes --- src/gui/transferlistwidget.cpp | 39 +++++++++++++++------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 8330c7e74..5efb3d51a 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -28,41 +28,36 @@ * Contact : chris@qbittorrent.org */ -#include -#include -#include -#include -#include +#include "transferlistwidget.h" + #include -#include -#include -#include -#include +#include #include +#include #include -#include +#include +#include #include +#include -#include "transferlistwidget.h" +#include "autoexpandabledialog.h" #include "base/bittorrent/session.h" #include "base/bittorrent/torrenthandle.h" #include "base/logger.h" +#include "base/preferences.h" #include "base/torrentfilter.h" -#include "transferlistdelegate.h" +#include "base/utils/fs.h" +#include "base/utils/string.h" +#include "deletionconfirmationdlg.h" +#include "guiiconprovider.h" +#include "mainwindow.h" +#include "optionsdlg.h" #include "previewselect.h" #include "speedlimitdlg.h" -#include "updownratiodlg.h" -#include "optionsdlg.h" -#include "mainwindow.h" -#include "base/preferences.h" #include "torrentmodel.h" -#include "deletionconfirmationdlg.h" -#include "propertieswidget.h" -#include "guiiconprovider.h" -#include "base/utils/fs.h" -#include "base/utils/string.h" -#include "autoexpandabledialog.h" +#include "transferlistdelegate.h" #include "transferlistsortmodel.h" +#include "updownratiodlg.h" static QStringList extractHashes(const QList &torrents);