|
|
|
@ -30,6 +30,7 @@ struct TOCItem |
|
|
|
QString text; |
|
|
|
QString text; |
|
|
|
Okular::DocumentViewport viewport; |
|
|
|
Okular::DocumentViewport viewport; |
|
|
|
QString extFileName; |
|
|
|
QString extFileName; |
|
|
|
|
|
|
|
QString url; |
|
|
|
bool highlight : 1; |
|
|
|
bool highlight : 1; |
|
|
|
TOCItem *parent; |
|
|
|
TOCItem *parent; |
|
|
|
QList< TOCItem* > children; |
|
|
|
QList< TOCItem* > children; |
|
|
|
@ -84,6 +85,7 @@ TOCItem::TOCItem( TOCItem *_parent, const QDomElement &e ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extFileName = e.attribute( "ExternalFileName" ); |
|
|
|
extFileName = e.attribute( "ExternalFileName" ); |
|
|
|
|
|
|
|
url = e.attribute( "URL" ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TOCItem::~TOCItem() |
|
|
|
TOCItem::~TOCItem() |
|
|
|
@ -337,4 +339,13 @@ Okular::DocumentViewport TOCModel::viewportForIndex( const QModelIndex &index ) |
|
|
|
return item->viewport; |
|
|
|
return item->viewport; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString TOCModel::urlForIndex( const QModelIndex &index ) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if ( !index.isValid() ) |
|
|
|
|
|
|
|
return QString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TOCItem *item = static_cast< TOCItem* >( index.internalPointer() ); |
|
|
|
|
|
|
|
return item->url; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#include "tocmodel.moc" |
|
|
|
#include "tocmodel.moc" |
|
|
|
|