diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index e791ba457..0cfeb88bf 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -245,7 +245,6 @@ void PropertiesWidget::loadTorrentInfos(const QTorrentHandle &_h) { try { // Save path updateSavePath(h); - changeSavePathButton->setEnabled(h.has_metadata()); // Hash hash_lbl->setText(h.hash()); PropListModel->model()->clear(); @@ -662,56 +661,6 @@ bool PropertiesWidget::applyPriorities() { return true; } - -void PropertiesWidget::on_changeSavePathButton_clicked() { - if (!h.is_valid()) return; - QString new_path; - if (h.has_metadata() && h.num_files() == 1) { - new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), h.firstFileSavePath()); - } else { - const QDir saveDir(TorrentPersistentData::getSavePath(h.hash())); - new_path = QFileDialog::getExistingDirectory(this, tr("Choose save path"), saveDir.absolutePath(), - QFileDialog::DontConfirmOverwrite|QFileDialog::ShowDirsOnly|QFileDialog::HideNameFilterDetails); - } - if (!new_path.isEmpty()) { - // Check if savePath exists - QString save_path_dir = new_path.replace("\\", "/"); - QString new_file_name; - if (h.has_metadata() && h.num_files() == 1) { - save_path_dir = fsutils::branchPath(save_path_dir, &new_file_name); // Skip file name - } - QDir savePath(fsutils::expandPath(save_path_dir)); - // Actually move storage - if (!QBtSession::instance()->useTemporaryFolder() || h.is_seed()) { - if (!savePath.exists()) savePath.mkpath(savePath.absolutePath()); - h.move_storage(savePath.absolutePath()); - } - // Update save_path in dialog - QString display_path; - if (h.has_metadata() && h.num_files() == 1) { - // Rename the file - Q_ASSERT(!new_file_name.isEmpty()); -#if defined(Q_WS_WIN) || defined(Q_OS_OS2) - if (h.filename_at(0).compare(new_file_name, Qt::CaseInsensitive) != 0) { -#else - if (h.filename_at(0).compare(new_file_name, Qt::CaseSensitive) != 0) { -#endif - qDebug("Renaming single file to %s", qPrintable(new_file_name)); - h.rename_file(0, new_file_name); - // Also rename it in the files list model - PropListModel->setData(PropListModel->index(0, 0), new_file_name); - } - display_path = h.firstFileSavePath(); - } else { - display_path = savePath.absolutePath(); - } -#if defined(Q_WS_WIN) || defined(Q_OS_OS2) - display_path.replace("/", "\\"); -#endif - save_path->setText(display_path); - } -} - void PropertiesWidget::filteredFilesChanged() { if (h.is_valid()) { applyPriorities(); diff --git a/src/properties/propertieswidget.h b/src/properties/propertieswidget.h index cb098557f..c3942b307 100644 --- a/src/properties/propertieswidget.h +++ b/src/properties/propertieswidget.h @@ -79,7 +79,6 @@ protected slots: void askWebSeed(); void deleteSelectedUrlSeeds(); void displayFilesListMenu(const QPoint& pos); - void on_changeSavePathButton_clicked(); void filteredFilesChanged(); void showPiecesDownloaded(bool show); void showPiecesAvailability(bool show); diff --git a/src/properties/propertieswidget.ui b/src/properties/propertieswidget.ui index 73cb212bc..edee14d0a 100644 --- a/src/properties/propertieswidget.ui +++ b/src/properties/propertieswidget.ui @@ -7,7 +7,7 @@ 0 0 551 - 274 + 452 @@ -49,8 +49,8 @@ 0 0 - 534 - 451 + 549 + 447 @@ -365,22 +365,6 @@ - - - - - 22 - 15 - - - - ... - - - false - - - @@ -548,22 +532,6 @@ - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Lucida Grande'; font-size:8pt; font-weight:400; font-style:normal;"> -<table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> -<tr> -<td style="border: none;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Cantarell';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu';"></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans';"></p></td></tr></table></body></html> - true