Bug 407883

Summary: Previous/Next Bookmark actions not enabled/disabled correctly / do not cycle though bookmarks
Product: [Applications] okular Reporter: Laura David Hurka <laura.stern>
Component: generalAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: minor CC: nate
Priority: NOR    
Version: 1.7.1   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:

Description Laura David Hurka 2019-05-23 22:48:57 UTC
SUMMARY
Just discovered that the context menu in the view area and the Bookmarks menu offer the two actions “Previous Bookmark” and “Next Bookmark”.
These two are enabled as soon as there are Bookmarks in the current document.
But they are enabled always, even if there is no previous or next bookmark. Clicking this action has no effect then.

STEPS TO REPRODUCE
1. Open a document with many pages
2. Create some bookmarks somewhere in the middle
3. Go to the end of the document
4. Open the context menu in the view area or the Bookmarks menu

OBSERVED RESULT
Both actions “Previous Bookmark” and “Next Bookmark” are enabled. Clicking “Next Bookmark” has no effect.

EXPECTED RESULT
Only Previous Bookmark is enabled, because there is no next bookmark. Alternative: Previous/Next Bookmark cycle though bookmarks, so Next Bookmark goes to the first bookmark.

SOFTWARE/OS VERSIONS
KDE Neon 5.15.5
KDE Plasma 5.58.0
Qt 5.12.0
Okular 1.7.1

ADDITIONAL INFORMATION
These actions are Okular::Part::m_prevBookmark and m_nextBookmark.
They are updated in Okular::Part::rebuildBookmarkMenu(), which assumes cycling behaviour.

To fix this, we need to decide whether these actions shall cycle though bookmarks or not.