From 301294fbff382146f04c62a99d231af6bde804e0 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Mon, 15 Dec 2014 23:00:00 +0100 Subject: [PATCH 1/2] Remove unneeded check on filenames The same check is performed in fsutils::fileExtension() --- src/qtlibtorrent/qbtsession.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index cb2485f55..c8dfd4c70 100755 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -1755,10 +1755,7 @@ bool QBtSession::isFilePreviewPossible(const QString &hash) const { } const unsigned int nbFiles = h.num_files(); for (unsigned int i=0; i Date: Mon, 15 Dec 2014 23:00:00 +0100 Subject: [PATCH 2/2] Open files with ".!qB" appended to the filename Filenames do not include ".!qB" in the file list, so the generated path could be wrong. --- src/properties/propertieswidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/properties/propertieswidget.cpp b/src/properties/propertieswidget.cpp index 39dc0fc2a..a0d091073 100644 --- a/src/properties/propertieswidget.cpp +++ b/src/properties/propertieswidget.cpp @@ -463,11 +463,14 @@ void PropertiesWidget::openFolder(const QModelIndex &index, bool containing_fold const QDir saveDir(h.save_path()); const QString filename = path_items.join("/"); - const QString file_path = fsutils::expandPath(saveDir.absoluteFilePath(filename)); - qDebug("Trying to open folder at %s", qPrintable(file_path)); // Flush data h.flush_cache(); + QString file_path = fsutils::expandPath(saveDir.absoluteFilePath(filename)); + if (QFile::exists(file_path + ".!qB")) + file_path += ".!qB"; + qDebug("Trying to open folder at %s", qPrintable(file_path)); + #ifdef Q_OS_WIN if (containing_folder) { // Syntax is: explorer /select, "C:\Folder1\Folder2\file_to_select"