This patch fixes three issues all related to the context manager and item selection model:
Problem 1
Bug: Right clicking an image when no image was previously selected resulted in a mostly unpopulated context menu
Cause: The selectionChanged signal which triggers available image operations to be updated) was queued, and
therefore not emitted before the context menu was shown.
Fix: Do not queue this signal, instead emit it immediately.
Problem 2
Bug: Sometimes the image Operations in the sidebar and toolbar wouldn't activate when selecting an image. This
was always the case when seleting an image using the hover select button when no image was previously selected.
Cause: The URL was only updated when the current index changed. However the currentChanged signal was not
emitted when deselecting all images, or selecting the same image as was previously selected. This resulted in a
borken state where we had an image selected but the current URL was blank.
Fix: Ignore the currentChanged signal on the selection model, and instead rely solely on selectionChanged.
Problem 3
Bug: If no images are selected, the Previous/Next toolbar buttons remained active according to the 'current'
item as determined by the selection model.
Cause: The decision on whether to enable/disable these buttons did not check whether an item was selected.
Fix: Check selection - if nothing selected, disable both buttons.
Fixes T8123: Context menu and sidebar sometimes populated incorrectly