validate the config before checking if it can be applied
ClosedPublic

Authored by sebas on May 4 2016, 2:14 AM.

Details

Summary

canBeApplied is public API, it shouldn't blow up when passed an invalid
config, but indicate (correctly!) that this "config" can't be applied.

This is called a bit carelessly from the kded daemon. I've fixed it
there as well, but it seems prudent to also make sure in libkscreen that
the user doesn't do stupid things.

CCBUG:362586

Test Plan

autotests pass

Diff Detail

Repository
R110 KScreen Library
Branch
sebas/guardcanbeapplied
Lint
No Linters Available
Unit
No Unit Test Coverage
sebas updated this revision to Diff 3631.May 4 2016, 2:14 AM
sebas retitled this revision from to validate the config before checking if it can be applied.
sebas updated this object.
sebas edited the test plan for this revision. (Show Details)
sebas added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 4 2016, 2:14 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

what about a test case for it?

sebas updated this revision to Diff 3645.May 4 2016, 10:38 PM
  • autotest for null config
graesslin accepted this revision.May 6 2016, 6:01 AM
graesslin added a reviewer: graesslin.
graesslin added inline comments.
src/config.cpp
104

you don't need to add "canBeApplied" - the method name can be set through QT_MESSAGE_PATTERN

This revision is now accepted and ready to land.May 6 2016, 6:01 AM
This revision was automatically updated to reflect the committed changes.