1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-13 08:17:57 +00:00

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
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -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);