[KRunner] Avoid writing history if addToHistory is idempotent

Authored by bruns on Apr 9 2019, 1:11 AM.

Description

[KRunner] Avoid writing history if addToHistory is idempotent

Summary:
It is not uncommon to run the same command repeatedly. In this case,
the history is actually unchanged - the item is removed from the first
position, and prepended again.

Test Plan:
run the same command twice, config file is not rewritten
run a new command, config is updated

Reviewers: Plasma, broulik, apol

Reviewed By: Plasma, broulik

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D20383

Details