Fix random order of GnuPG configuration components by defining pre-defined order.
Details
- Reviewers
mlaurent dvratil - Maniphest Tasks
- T6445: The tab order of the GnuPG options is not stable
- Commits
- R90:abe521db67a6: Fix gpg configuration dialog tabs order
- Build Kleoptra with new version of libkleo
- Open Kleopatra configuration window several times.
It can be done from Kleopatra main menu or by running kcmshell5 --desktopfile kleopatra_config_gnupgsystem.desktop kleopatra_config_gnupgsystem
Expected result: order of tabs should be fixed to:
gpg, gpgsm, gpg-agent, dirmngr, pinentry, scdaemon
Any other components (if any) should go after predefined order in alphabetical order.
Diff Detail
- Repository
- R90 PIM: Kleo Library
- Lint
Lint Skipped - Unit
Unit Tests Skipped
src/ui/cryptoconfigmodule.cpp | ||
---|---|---|
236 | Make it static, there's no need to initialize this every time. It could also be something more efficient than QStringList, like std::array (since we know the size of the list beforehand). | |
263 | You could just resolve the others list using another for loop and !result.contains() and get rid of all the QSets completely. The order list as well as the components list will always be short enough so that the two QSets (and the cost of constructing and subtracting them) will not be measurably faster than two for loops and a linear check. |
src/ui/cryptoconfigmodule.cpp | ||
---|---|---|
236 | Makes sense. Done. | |
263 | You're right. I didn't think about small amount of items, tried to write universal code. |
src/ui/cryptoconfigmodule.cpp | ||
---|---|---|
236 | Technically there's no difference, the meaning is the same. But the are people who would argue with you endlessly about which way is the truly correct way of writing static const :) |