From 721fa821f7b175b102832fda39b387b7344ef5cf Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 23 Jan 2011 08:34:57 +0000 Subject: [PATCH] BUGFIX: Fix renaming of single-file torrents (by Vladimir Golovnev) --- AUTHORS | 1 + src/misc.cpp | 2 +- src/properties/propertieswidget.cpp | 1 + 3 files changed, 3 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/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));