mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 23:47:23 -06:00
Expand single-item folders in torrent content
This commit is contained in:
@@ -625,8 +625,12 @@ void AddNewTorrentDialog::setupTreeview()
|
||||
m_ui->contentTreeView->hideColumn(REMAINING);
|
||||
m_ui->contentTreeView->hideColumn(AVAILABILITY);
|
||||
|
||||
// Expand root folder
|
||||
m_ui->contentTreeView->setExpanded(m_contentModel->index(0, 0), true);
|
||||
// Expand single-item folders recursively
|
||||
QModelIndex currentIndex;
|
||||
while (m_contentModel->rowCount(currentIndex) == 1) {
|
||||
currentIndex = m_contentModel->index(0, 0, currentIndex);
|
||||
m_ui->contentTreeView->setExpanded(currentIndex, true);
|
||||
}
|
||||
}
|
||||
|
||||
updateDiskSpaceLabel();
|
||||
|
||||
Reference in New Issue
Block a user