I had every toplevel entry doubled in kontact's configuration dialog
due to $XDG_DATA_DIRS=<myPrefix>/share:/usr/share
which led to parsing both
<myPrefix>/share/kontact/ksettingsdialog/knotes.setdlg
and
/usr/share/kontact/ksettingsdialog/knotes.setdlg
Details
Diff Detail
- Repository
- R295 KCMUtils
- Branch
- fix_duplicates
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 25087 Build 25105: arc lint + arc unit
Why not instead use a QMap<QString /* relative filename */, QString /* absolute path */ > to collect the files? This way you wouldn't need the double QStandardPaths lookup.
src/ksettings/dialog.cpp | ||
---|---|---|
317 | I think I read once that whenever you used a ordered map over an unordered map, you need to justify it by talking to your manager about it. But that's also a bit from the bucket of nitpickery unless we are in a hot codepath. | |
326 | nitpickery. but range based for and qAsConst on container? |
src/ksettings/dialog.cpp | ||
---|---|---|
317 | Interesting. This makes it sound like "ordering" is a feature that costs extra. Anyhow, for 5-10 items nothing makes a difference. | |
326 | For a QMap? I think this iterates over pairs, so it only looks nice with C++17 structured bindings. |