Since
https://codereview.qt-project.org/#/c/114805/4
Qt supports reading qtlogging.ini from QLibraryInfo::DataPath too, make kdebugsettings follow suit.
mlaurent |
Since
https://codereview.qt-project.org/#/c/114805/4
Qt supports reading qtlogging.ini from QLibraryInfo::DataPath too, make kdebugsettings follow suit.
Lint Skipped |
Unit Tests Skipped |
nope it's incorrect.
You call twice readCategoriesFiles, you will duplicate list of categories.
So you need to choose QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(QStringLiteral("qtlogging.ini")); or QStandardPaths::locate(QStandardPaths::GenericConfigLocation, QStringLiteral("QtProject/qtlogging.ini")); but not twice.
We need to see if envPath is empty and load dataPath and not loading this two files.
I think that the idea is to read both: the defaults from the system locations, which can be overridden by the local settings.
(otherwise users wouldn't be allowed to override global settings, which is definitely not acceptable).
if there is not a settings in local it can load global settings
when we modify it will store all settings in local
after that you will load from local which is a global settings modified.
So I don't see the problem.