Skip to content
Commit 9432565e authored by snooxx 💤's avatar snooxx 💤 Committed by Albert Astals Cid
Browse files

Fix broken page MiniBar

The `MiniBar` normally used to display page numbers and to provide
navigation buttons regressed since 01557c16 to only show an empty
non-functional button called "Page Number", along with multiple
warnings:
`QObject::connect(MiniBar, QAction): invalid nullptr parameter`

This is caused by moving `setupViewerActions()` to a place where
`m_miniBar` is not initialized yet, even though it has a runtime
`connect`-dependency on it.

By moving `setupViewerActions()` back, the `MiniBar` starts working
again. Now the `m_addBookmark` action, which is created in that
function, is not available anymore to be passed to the constructor of
`BookmarkList`. To avoid moving the setup of the latter away from the
rest of the sidebar code, only assigning the action to the bookmark
button contained in the `BookmarkList` is deferred to
`setupViewerActions()`.

As requested, any accidental future `nullptr`-access will be handled by
crashing, even in Release builds, by omitting any checks.

BUG: 450347

Test Plan:

Page numbers show up again in toolbar, no more `connect` warnings.
parent 0197a78f
Pipeline #141270 passed with stage
in 4 minutes and 55 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment