From 75a65a5f4912ce02957e749e7615be7637d73775 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 29 May 2012 18:32:18 +0300 Subject: [PATCH] Make sure !.qB extensions are not shown in the Web UI --- src/webui/btjson.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index aa86b2790..a1b95039a 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -330,7 +330,10 @@ QString btjson::getFilesForTorrent(const QString& hash) h.file_progress(fp); for (int i = 0; i < h.num_files(); ++i) { JsonDict file_dict; - file_dict.add(KEY_FILE_NAME, h.filename_at(i)); + QString fileName = h.filename_at(i); + if (fileName.endsWith(".!qB", Qt::CaseInsensitive)) + fileName.chop(4); + file_dict.add(KEY_FILE_NAME, fileName); const size_type size = h.filesize_at(i); file_dict.add(KEY_FILE_SIZE, misc::friendlyUnit(size)); file_dict.add(KEY_FILE_PROGRESS, (size > 0) ? (fp[i] / (double) size) : 1.);