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.
This commit is contained in:
Chocobo1
2020-08-29 19:57:38 +08:00
parent 307ca61c86
commit eb1a3e2b29

View File

@@ -545,8 +545,9 @@ void PropertiesWidget::openFolder(const QModelIndex &index, const bool containin
// FOLDER // FOLDER
if (m_propListModel->itemType(index) == TorrentContentModelItem::FolderType) { if (m_propListModel->itemType(index) == TorrentContentModelItem::FolderType) {
// Generate relative path to selected folder // Generate relative path to selected folder
QStringList pathItems {index.data().toString()}; const QModelIndex nameIndex {index.sibling(index.row(), TorrentContentModelItem::COL_NAME)};
QModelIndex parent = m_propListModel->parent(index); QStringList pathItems {nameIndex.data().toString()};
QModelIndex parent = m_propListModel->parent(nameIndex);
while (parent.isValid()) { while (parent.isValid()) {
pathItems.prepend(parent.data().toString()); pathItems.prepend(parent.data().toString());
parent = m_propListModel->parent(parent); parent = m_propListModel->parent(parent);