support loading qtlogging.ini from QLibraryInfo::DataPath too
ClosedPublic

Authored by rdieter on Feb 2 2017, 3:02 PM.

Details

Reviewers
mlaurent
Summary

Since
https://codereview.qt-project.org/#/c/114805/4

Qt supports reading qtlogging.ini from QLibraryInfo::DataPath too, make kdebugsettings follow suit.

Diff Detail

Repository
R355 KDebugSettings
Lint
Lint Skipped
Unit
Unit Tests Skipped
rdieter updated this revision to Diff 10851.Feb 2 2017, 3:02 PM
rdieter retitled this revision from to support loading qtlogging.ini from QLibraryInfo::DataPath too.
rdieter updated this object.
rdieter edited the test plan for this revision. (Show Details)
rdieter set the repository for this revision to R355 KDebugSettings.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptFeb 2 2017, 3:02 PM
rdieter updated this object.Feb 2 2017, 3:06 PM
mlaurent requested changes to this revision.Feb 3 2017, 8:57 AM
mlaurent edited edge metadata.

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.

This revision now requires changes to proceed.Feb 3 2017, 8:57 AM

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).

mlaurent added a comment.EditedFeb 12 2017, 7:15 AM

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.

rdieter updated this revision to Diff 11603.Feb 21 2017, 8:32 PM
rdieter edited edge metadata.

Update to only fallback to other location if envPath is empty

mlaurent accepted this revision.Feb 22 2017, 5:02 PM

Seems ok now.
Regards

This revision is now accepted and ready to land.Feb 22 2017, 5:02 PM
rdieter closed this revision.Mar 1 2017, 7:52 PM

I botched the commit log to autoclose this, so try manually