mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-05 14:47:25 +03:00
BUGFIX: Fix renaming of single-file torrents (by Vladimir Golovnev)
This commit is contained in:
parent
6580d23263
commit
721fa821f7
3 changed files with 3 additions and 1 deletions
1
AUTHORS
1
AUTHORS
|
@ -2,6 +2,7 @@ Author:
|
||||||
* Christophe Dumez <chris@qbittorrent.org>
|
* Christophe Dumez <chris@qbittorrent.org>
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
|
* Vladimir Golovnev <glassez@yandex.ru>
|
||||||
* Stefanos Antaris <santaris@csd.auth.gr>
|
* Stefanos Antaris <santaris@csd.auth.gr>
|
||||||
* Mohammad Dib <mdib@qbittorrent.org>
|
* Mohammad Dib <mdib@qbittorrent.org>
|
||||||
* Mirco Chinelli <infinity89@fastwebmail.it>
|
* Mirco Chinelli <infinity89@fastwebmail.it>
|
||||||
|
|
|
@ -793,5 +793,5 @@ QString misc::fileName(QString file_path)
|
||||||
const int slash_index = file_path.lastIndexOf('/');
|
const int slash_index = file_path.lastIndexOf('/');
|
||||||
if(slash_index == -1)
|
if(slash_index == -1)
|
||||||
return file_path;
|
return file_path;
|
||||||
return file_path.mid(slash_index);
|
return file_path.mid(slash_index+1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -714,6 +714,7 @@ void PropertiesWidget::on_changeSavePathButton_clicked() {
|
||||||
QString save_path_dir = new_path.replace("\\", "/");
|
QString save_path_dir = new_path.replace("\\", "/");
|
||||||
QString new_file_name;
|
QString new_file_name;
|
||||||
if(h.has_metadata() && h.num_files() == 1) {
|
if(h.has_metadata() && h.num_files() == 1) {
|
||||||
|
new_file_name = misc::fileName(save_path_dir); // New file name
|
||||||
save_path_dir = misc::branchPath(save_path_dir, true); // Skip file name
|
save_path_dir = misc::branchPath(save_path_dir, true); // Skip file name
|
||||||
}
|
}
|
||||||
QDir savePath(misc::expandPath(save_path_dir));
|
QDir savePath(misc::expandPath(save_path_dir));
|
||||||
|
|
Loading…
Reference in a new issue