lxqt-globalkeys icon indicating copy to clipboard operation
lxqt-globalkeys copied to clipboard

feature request: remove magic numbers in configuration

Open wxl opened this issue 5 years ago • 3 comments

In the configuration file, shortcuts are appended with a period and a number, indicating its sequence in the list. These numbers change, however, and are ultimately pointless. They further complicate modifying configuration files by hand rather than from the GUI.

Expected Behavior

There's no magic numbers in the configuration file.

Current Behavior

Magic numbers create all sorts of madness.

Possible Solution

Remove the numbers in the configuration file and merely let the code create the enumeration in the GUI based on some default sorting methodology. In this case, where the definitions appeared in the file wouldn't matter.

The one case where it seems to make sense to indicate a difference between shortcuts (perhaps through numbers) is if there are two definitions for the same shortcut. This wouldn't make sense if they were both enabled but one could be enabled and one could be disabled. In this case, it would be good to append a number to the shortcut. There could be logic to check for duplicates and renumber them as needed.

System Information
  • Distribution & Version: Lubuntu 19.10
  • Kernel: 5.0.0
  • Qt Version: 5.12.2
  • liblxqt Version: 0.14.1
  • lxqt-build-tools Version: 0.6.0
  • Package version: 0.14.1

wxl avatar Jul 15 '19 05:07 wxl

Second that with my whole heart :D, reason in the next bug.

agaida avatar Aug 22 '19 17:08 agaida

~I agree too.~

tsujan avatar Aug 22 '19 19:08 tsujan

I changed my mind because the code allows a key sequence to be repeated but decides which one should be activated. IMO, that's acceptable. The appended numbers are needed for such a design.

tsujan avatar Aug 23 '19 08:08 tsujan