klipper: always set clipboard when moving entry to top

Reason for the change

When moving an entry to the top of the history (typically by selecting it in the klipper applet/popup), it's set as the current history entry - unless it already is at the top, in which case nothing happens. This means that if the current clipboard contents are not saved in the history (e.g. because it's an image and those are set to be not saved, as is the default), you can't select the top item to be the clipboard contents; attempting to do so will fail because it's already at the top.

Instead, always set an entry as the current clipboard contents when moving it to the top.

Test plan

Make sure saving images is turned off, copy text, copy image, try to set the clipboard to the copied text from the history.

Screenshots or screen recordings

N/A

Bugs fixed

BUG: 514095


Not 100% confident this is correct; there already is a comment that this can happen in the code. Seems that prior to 1f5d3148 (possibly later) there was some code that should have set the clipboard in that case, but I haven't quite mapped out the signal chain between all the parts that were involved then.

@fusionfuture

Merge request reports

Loading