diff --git a/src/GUI.h b/src/GUI.h index 8130fed04..95e39f46b 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -69,6 +69,7 @@ public: QWidget* getCurrentTabWidget() const; TransferListWidget* getTransferList() const { return transferList; } QMenu* getTrayIconMenu(); + PropertiesWidget *getProperties() const { return properties; } public slots: void trackerAuthenticationRequired(QTorrentHandle& h); diff --git a/src/propertieswidget.h b/src/propertieswidget.h index ded74a386..5855286f7 100644 --- a/src/propertieswidget.h +++ b/src/propertieswidget.h @@ -99,7 +99,6 @@ protected slots: void filteredFilesChanged(); void showPiecesDownloaded(bool show); void showPiecesAvailability(bool show); - void updateSavePath(QTorrentHandle& h); void renameSelectedFile(); void selectAllFiles(); void selectNoneFiles(); @@ -113,6 +112,7 @@ public slots: void saveSettings(); void reloadPreferences(); void openDoubleClickedFile(QModelIndex); + void updateSavePath(QTorrentHandle& h); }; diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 4dba5b16d..51c4966de 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -38,6 +38,7 @@ #include "GUI.h" #include "preferences.h" #include "deletionconfirmationdlg.h" +#include "propertieswidget.h" #include #include #include @@ -630,7 +631,8 @@ void TransferListWidget::setSelectedTorrentsLocation() { const QStringList hashes = getSelectedTorrentsHashes(); if(hashes.isEmpty()) return; QString dir; - const QDir saveDir(BTSession->getTorrentHandle(hashes.first()).save_path()); + const QDir saveDir(TorrentPersistentData::getSavePath(hashes.first())); + qDebug("Torrent save path is %s", qPrintable(saveDir.absolutePath())); if(saveDir.exists()){ dir = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.path()); }else{ @@ -648,8 +650,12 @@ void TransferListWidget::setSelectedTorrentsLocation() { foreach(const QString & hash, hashes) { // Actually move storage QTorrentHandle h = BTSession->getTorrentHandle(hash); - if(!BTSession->useTemporaryFolder() || h.is_seed()) + if(!BTSession->useTemporaryFolder() || h.is_seed()) { h.move_storage(savePath.absolutePath()); + } else { + TorrentPersistentData::saveSavePath(h.hash(), savePath.absolutePath()); + main_window->getProperties()->updateSavePath(h); + } } } }