Skip to content

KRecentFilesAction: fix recent files that have been added to the menu a second time

This fixes https://bugs.kde.org/show_bug.cgi?id=453800

In short, in Kate, KDevelop and any user of KRecentFilesAction, when a file is opened and is already in the recent files menu, it is removed and then re-added.

In the current code, the existing action for this file is reused. This does not seem to work (anymore?). This contribution modifies KRecentFilesAction so it stops reusing the same action and create a new one.

The fix is in the first commit. The second commit is a refactor suggestion and can be dropped (it's not necessary for the fix).

Still, I think the original code should be working, I don't see why an action could not be reused. Some investigation from someone more experimented than me should probably look at this. The bug might be in Qt itself.

See https://bugs.kde.org/show_bug.cgi?id=453800 for the investigations.

Edited by Raphaël Jakse

Merge request reports