mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 21:14:33 +00:00
Expand single-item folders in torrent content
This commit is contained in:
parent
d12468ffb5
commit
b37795d344
@ -625,8 +625,12 @@ void AddNewTorrentDialog::setupTreeview()
|
|||||||
m_ui->contentTreeView->hideColumn(REMAINING);
|
m_ui->contentTreeView->hideColumn(REMAINING);
|
||||||
m_ui->contentTreeView->hideColumn(AVAILABILITY);
|
m_ui->contentTreeView->hideColumn(AVAILABILITY);
|
||||||
|
|
||||||
// Expand root folder
|
// Expand single-item folders recursively
|
||||||
m_ui->contentTreeView->setExpanded(m_contentModel->index(0, 0), true);
|
QModelIndex currentIndex;
|
||||||
|
while (m_contentModel->rowCount(currentIndex) == 1) {
|
||||||
|
currentIndex = m_contentModel->index(0, 0, currentIndex);
|
||||||
|
m_ui->contentTreeView->setExpanded(currentIndex, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDiskSpaceLabel();
|
updateDiskSpaceLabel();
|
||||||
|
@ -322,8 +322,13 @@ void PropertiesWidget::loadTorrentInfos(BitTorrent::TorrentHandle *const torrent
|
|||||||
|
|
||||||
// List files in torrent
|
// List files in torrent
|
||||||
m_propListModel->model()->setupModelData(m_torrent->info());
|
m_propListModel->model()->setupModelData(m_torrent->info());
|
||||||
if (m_propListModel->model()->rowCount() == 1)
|
|
||||||
m_ui->filesList->setExpanded(m_propListModel->index(0, 0), true);
|
// Expand single-item folders recursively
|
||||||
|
QModelIndex currentIndex;
|
||||||
|
while (m_propListModel->rowCount(currentIndex) == 1) {
|
||||||
|
currentIndex = m_propListModel->index(0, 0, currentIndex);
|
||||||
|
m_ui->filesList->setExpanded(currentIndex, true);
|
||||||
|
}
|
||||||
|
|
||||||
// Load file priorities
|
// Load file priorities
|
||||||
m_propListModel->model()->updateFilesPriorities(m_torrent->filePriorities());
|
m_propListModel->model()->updateFilesPriorities(m_torrent->filePriorities());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user