[Night Color] Check read in mode value
ClosedPublic

Authored by romangg on Dec 13 2017, 12:58 PM.

Details

Summary

This Diff is half a patch, half a question. I assumed KConfigSkeleton checks the enum value in the config file on being valid. But my failing integration test tells me, that it doesn't.

This patch does the value check explicitly. Or can I somehow do the check in KConfigSkeleton (maybe I did an error when implementing it)?

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Dec 13 2017, 12:58 PM
Restricted Application added a project: KWin. · View Herald TranscriptDec 13 2017, 12:58 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Dec 13 2017, 12:58 PM

From what I can tell if you store a string (e.g. Location) it will try to look it up in choices and return the corresponding choice number (1) but if you explicitly store a number in there, it will use that unconditionally.

graesslin added inline comments.
colorcorrection/manager.cpp
161

instead of 0 and 2 I would use enum values.

romangg updated this revision to Diff 23912.Dec 14 2017, 2:22 PM

No int casting.

graesslin accepted this revision.Dec 14 2017, 9:01 PM
This revision is now accepted and ready to land.Dec 14 2017, 9:01 PM
This revision was automatically updated to reflect the committed changes.