From eb1a3e2b297004fe6cab37fa17fd1918ee5b0a38 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 29 Aug 2020 19:57:38 +0800 Subject: [PATCH] Fix open path won't work correctly Previously, if double click on the Size number in torrent content tab the path would be an incorrect value and as such open path functionality won't work, this commit fixes it. --- src/gui/properties/propertieswidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index e3a1efc9b..53b36922a 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -545,8 +545,9 @@ void PropertiesWidget::openFolder(const QModelIndex &index, const bool containin // FOLDER if (m_propListModel->itemType(index) == TorrentContentModelItem::FolderType) { // Generate relative path to selected folder - QStringList pathItems {index.data().toString()}; - QModelIndex parent = m_propListModel->parent(index); + const QModelIndex nameIndex {index.sibling(index.row(), TorrentContentModelItem::COL_NAME)}; + QStringList pathItems {nameIndex.data().toString()}; + QModelIndex parent = m_propListModel->parent(nameIndex); while (parent.isValid()) { pathItems.prepend(parent.data().toString()); parent = m_propListModel->parent(parent);