mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
Unparent the old TOCModel so that it doesn't get deleted twice
BUG: 322919 FIXED-IN: 4.11.3
This commit is contained in:
parent
177235d5d7
commit
68439221ea
|
@ -96,6 +96,7 @@ void TOC::prepareForReload()
|
|||
TOCModel *m = m_model;
|
||||
m_model = new TOCModel( m_document, m_treeView );
|
||||
m_model->setOldModelData( m, list );
|
||||
m->setParent( 0 );
|
||||
}
|
||||
|
||||
void TOC::rollbackReload()
|
||||
|
@ -105,12 +106,14 @@ void TOC::rollbackReload()
|
|||
|
||||
TOCModel *m = m_model;
|
||||
m_model = m->clearOldModelData();
|
||||
m_model->setParent( m_treeView );
|
||||
delete m;
|
||||
}
|
||||
|
||||
void TOC::finishReload()
|
||||
{
|
||||
m_treeView->setModel( m_model );
|
||||
m_model->setParent( m_treeView );
|
||||
}
|
||||
|
||||
QVector<QModelIndex> TOC::expandedNodes( const QModelIndex &parent ) const
|
||||
|
|
Loading…
Reference in a new issue