From bd8c03ecd8bd5d34f51efcdddd5ed7dd737b5c48 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 23 Jan 2011 08:34:54 +0000 Subject: [PATCH] BUGFIX: Fix renaming of single-file torrents (by Vladimir Golovnev) --- AUTHORS | 1 + Changelog | 1 + src/misc.cpp | 2 +- src/properties/propertieswidget.cpp | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 3da26dca2..3f622cbfd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,7 @@ Author: * Christophe Dumez Contributors: +* Vladimir Golovnev * Stefanos Antaris * Mohammad Dib * Mirco Chinelli diff --git a/Changelog b/Changelog index c08016d38..fc2557c71 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ - BUGFIX: Improved hostname resolution code - BUGFIX: Dropped dependency on libboost-thread - BUGFIX: Display legal notice on screen center + - BUGFIX: Fix renaming of single-file torrents (by Vladimir Golovnev) - I18N: More dialog buttons are now translated (by Vladimir Golovnev) - I18N: Fix translation of size units (by Vladimir Golovnev) diff --git a/src/misc.cpp b/src/misc.cpp index 53204cb1d..438c6357f 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -793,5 +793,5 @@ QString misc::fileName(QString file_path) const int slash_index = file_path.lastIndexOf('/'); if(slash_index == -1) return file_path; - return file_path.mid(slash_index); + return file_path.mid(slash_index+1); } diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index e8f6c0175..33912c27c 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -714,6 +714,7 @@ void PropertiesWidget::on_changeSavePathButton_clicked() { QString save_path_dir = new_path.replace("\\", "/"); QString new_file_name; 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 } QDir savePath(misc::expandPath(save_path_dir));