Commit f84c2566 authored by Pino Toscano's avatar Pino Toscano

don't activate the TOC when it has no items

svn path=/trunk/KDE/kdegraphics/okular/; revision=753072
parent b92fce00
......@@ -79,7 +79,7 @@ void TOC::notifySetup( const QVector< Okular::Page * > & /*pages*/, int setupFla
// else populate the listview and enable the tab
m_model->fill( syn );
emit hasTOC( true );
emit hasTOC( !m_model->isEmpty() );
}
void TOC::notifyViewportChanged( bool /*smoothMove*/ )
......
......@@ -313,6 +313,11 @@ void TOCModel::setCurrentViewport( const Okular::DocumentViewport &viewport )
}
}
bool TOCModel::isEmpty() const
{
return d->root->children.isEmpty();
}
QString TOCModel::externalFileNameForIndex( const QModelIndex &index ) const
{
if ( !index.isValid() )
......
......@@ -41,6 +41,8 @@ class TOCModel : public QAbstractItemModel
void clear();
void setCurrentViewport( const Okular::DocumentViewport &viewport );
bool isEmpty() const;
QString externalFileNameForIndex( const QModelIndex &index ) const;
Okular::DocumentViewport viewportForIndex( const QModelIndex &index ) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment