BUGS: 313146
@ -73,14 +73,6 @@ void TOC::notifySetup( const QVector< Okular::Page * > & /*pages*/, int setupFla
// request synopsis description (is a dom tree)
const Okular::DocumentSynopsis * syn = m_document->documentSynopsis();
// if not present, disable the contents tab
if ( !syn )
{
emit hasTOC( false );
return;
}
// else populate the listview and enable the tab
m_model->fill( syn );
emit hasTOC( !m_model->isEmpty() );
@ -266,8 +266,12 @@ static QModelIndex indexForIndex( const QModelIndex &oldModelIndex, QAbstractIte
void TOCModel::fill( const Okular::DocumentSynopsis *toc )
if ( !toc )
if ( !toc ) {
delete d->m_oldModel;
d->m_oldModel = 0;
d->m_oldTocExpandedIndexes.clear();
clear();
emit layoutAboutToBeChanged();