1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

VerticalTabs: Preserve exapnded state of items inside collapsed parent

BUG: 393567
FIXED-IN: 3.0.1
This commit is contained in:
David Rosca 2018-04-29 12:49:55 +02:00
parent d55d071507
commit bc26e9377c
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -324,14 +324,14 @@ bool TabTreeView::viewportEvent(QEvent *event)
void TabTreeView::initView()
{
// Restore expanded state
expandAll();
QModelIndex index = model()->index(0, 0);
while (index.isValid()) {
WebTab *tab = index.data(TabModel::WebTabRole).value<WebTab*>();
if (tab) {
setExpanded(index, tab->sessionData().value(m_expandedSessionKey, true).toBool());
}
index = indexBelow(index);
for (int i = 0; i < model()->rowCount(); ++i) {
const QModelIndex index = model()->index(i, 0);
reverseTraverse(index, [this](const QModelIndex &index) {
WebTab *tab = index.data(TabModel::WebTabRole).value<WebTab*>();
if (tab) {
setExpanded(index, tab->sessionData().value(m_expandedSessionKey, true).toBool());
}
});
}
m_initializing = false;