mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-02 14:14:10 +00:00
don't activate the TOC when it has no items
svn path=/trunk/KDE/kdegraphics/okular/; revision=753072
This commit is contained in:
parent
b92fce0027
commit
f84c256657
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue