mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
VerticalTabs: Correctly delete models when switching view type
This commit is contained in:
parent
68c30781bb
commit
05bb94adfe
@ -53,6 +53,8 @@ void VerticalTabsWidget::setViewType(VerticalTabsPlugin::ViewType type)
|
||||
TabFilterModel *model = new TabFilterModel(m_normalView);
|
||||
model->setFilterPinnedTabs(true);
|
||||
|
||||
delete m_normalView->model();
|
||||
|
||||
switch (type) {
|
||||
case VerticalTabsPlugin::TabListView:
|
||||
model->setSourceModel(m_window->tabModel());
|
||||
@ -61,8 +63,7 @@ void VerticalTabsWidget::setViewType(VerticalTabsPlugin::ViewType type)
|
||||
break;
|
||||
|
||||
case VerticalTabsPlugin::TabTreeView:
|
||||
delete m_treeModel;
|
||||
m_treeModel = new TabTreeModel(this);
|
||||
m_treeModel = new TabTreeModel(model);
|
||||
m_treeModel->setSourceModel(m_window->tabModel());
|
||||
model->setSourceModel(m_treeModel);
|
||||
m_normalView->setModel(model);
|
||||
|
Loading…
Reference in New Issue
Block a user