Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Joao Oliveira
Okular
Commits
5bfb9dca
Commit
5bfb9dca
authored
Nov 30, 2008
by
Pino Toscano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for external URLs as destination for the TOC items.
svn path=/trunk/KDE/kdegraphics/okular/; revision=890883
parent
b43fe1ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
ui/toc.cpp
ui/toc.cpp
+8
-0
ui/tocmodel.cpp
ui/tocmodel.cpp
+11
-0
ui/tocmodel.h
ui/tocmodel.h
+1
-0
No files found.
ui/toc.cpp
View file @
5bfb9dca
...
...
@@ -105,6 +105,14 @@ void TOC::slotExecuted( const QModelIndex &index )
if
(
!
index
.
isValid
()
)
return
;
QString
url
=
m_model
->
urlForIndex
(
index
);
if
(
!
url
.
isEmpty
()
)
{
Okular
::
BrowseAction
action
(
url
);
m_document
->
processAction
(
&
action
);
return
;
}
QString
externalFileName
=
m_model
->
externalFileNameForIndex
(
index
);
Okular
::
DocumentViewport
viewport
=
m_model
->
viewportForIndex
(
index
);
if
(
!
externalFileName
.
isEmpty
()
)
...
...
ui/tocmodel.cpp
View file @
5bfb9dca
...
...
@@ -30,6 +30,7 @@ struct TOCItem
QString
text
;
Okular
::
DocumentViewport
viewport
;
QString
extFileName
;
QString
url
;
bool
highlight
:
1
;
TOCItem
*
parent
;
QList
<
TOCItem
*
>
children
;
...
...
@@ -84,6 +85,7 @@ TOCItem::TOCItem( TOCItem *_parent, const QDomElement &e )
}
extFileName
=
e
.
attribute
(
"ExternalFileName"
);
url
=
e
.
attribute
(
"URL"
);
}
TOCItem
::~
TOCItem
()
...
...
@@ -337,4 +339,13 @@ Okular::DocumentViewport TOCModel::viewportForIndex( const QModelIndex &index )
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"
ui/tocmodel.h
View file @
5bfb9dca
...
...
@@ -45,6 +45,7 @@ class TOCModel : public QAbstractItemModel
QString
externalFileNameForIndex
(
const
QModelIndex
&
index
)
const
;
Okular
::
DocumentViewport
viewportForIndex
(
const
QModelIndex
&
index
)
const
;
QString
urlForIndex
(
const
QModelIndex
&
index
)
const
;
private:
// storage
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment