mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-11 04:42:22 +00:00
Add the ability to choose the save path when using magnet links
This commit is contained in:
parent
82e2b3a6cd
commit
c12467ee3e
@ -200,8 +200,8 @@ void torrentAdditionDialog::showLoadMagnetURI(QString magnet_uri) {
|
||||
|
||||
// Disable Save path combox and browse button
|
||||
// Save path should be default for magnet links
|
||||
savePathTxt->setEnabled(false);
|
||||
browseButton->setEnabled(false);
|
||||
savePathTxt->setEnabled(true);
|
||||
browseButton->setEnabled(true);
|
||||
|
||||
// Get torrent hash
|
||||
hash = misc::magnetUriToHash(magnet_uri);
|
||||
@ -528,10 +528,10 @@ void torrentAdditionDialog::updateDiskSpaceLabels() {
|
||||
}
|
||||
|
||||
void torrentAdditionDialog::on_browseButton_clicked() {
|
||||
Q_ASSERT(!is_magnet);
|
||||
QString new_path;
|
||||
QString root_folder;
|
||||
const QString label_name = comboLabel->currentText();
|
||||
if (!is_magnet) {
|
||||
if (t->num_files() == 1) {
|
||||
new_path = QFileDialog::getSaveFileName(this, tr("Choose save path"), savePathTxt->currentText(), QString(), 0, QFileDialog::DontConfirmOverwrite);
|
||||
if (!new_path.isEmpty()) {
|
||||
@ -545,6 +545,7 @@ void torrentAdditionDialog::on_browseButton_clicked() {
|
||||
// Construct new_path
|
||||
new_path = path_parts.join(QDir::separator());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QString truncated_path = getCurrentTruncatedSavePath(&root_folder);
|
||||
if (!truncated_path.isEmpty() && QDir(truncated_path).exists()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user