Skip to content

Fix incorrect numbering in full screen mode for the first image

The function FullScreenContent::updateDocumentCountLabel() is responsible for updating the UI element that shows numbering in full screen mode. However, it is only called once when Gwenview is launched to display an image (e.g., from a file explorer or terminal). At that point, the function pulls data from the model (an instance of SortedDirModel), but the model isn't fully loaded, and it also requires an index to be selected before providing accurate data. The correct timing for when the model can return valid data happens in the slot ContextManager::selectUrlToSelect(), specifically, when the selected index is not the root.

As a result, the data displayed is incorrect, showing 0 of 0 which are default values.

This modification resolves the issue by connecting the signal ContextManager::selectionChanged() to the FullScreenContent::updateDocumentCountLabel() slot, which is emitted when the model selection changes. To enable this, the slot needs to be made public so it can be accessed from another class.

Related to: !12

BUG: 406105

Merge request reports

Loading