From 8690497be722b321f6752642775b1cd93f426c98 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 25 Oct 2017 15:21:46 +0200 Subject: [PATCH] Add Page::annotation Will use it later --- core/page.cpp | 10 ++++++++++ core/page.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/core/page.cpp b/core/page.cpp index 8bdd5e6dc..7fe78edfb 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -488,6 +488,16 @@ QLinkedList< Annotation* > Page::annotations() const return m_annotations; } +Annotation * Page::annotation( const QString & uniqueName ) const +{ + foreach(Annotation *a, m_annotations) + { + if ( a->uniqueName() == uniqueName ) + return a; + } + return nullptr; +} + const Action * Page::pageAction( PageAction action ) const { switch ( action ) diff --git a/core/page.h b/core/page.h index 70f89ea03..b3b71944e 100644 --- a/core/page.h +++ b/core/page.h @@ -249,6 +249,12 @@ class OKULARCORE_EXPORT Page */ QLinkedList< Annotation* > annotations() const; + /** + * Returns the annotation with the given unique name. + * @since TODO + */ + Annotation * annotation( const QString & uniqueName ) const; + /** * Returns the @ref Action object which is associated with the given page @p action * or 0 if no page action is set.