Generate an instance with KSharedConfig::Ptr for singleton and arg
ClosedPublic

Authored by graesslin on Dec 15 2016, 6:01 PM.

Details

Summary

In case a kcfg with arg="true" was used and singleton the static
instance method only accepted a QString config name. This made it
impossible to combine a singleton config with an already existing and
open KSharedConfig::Ptr.

With this change an overloaded instance method is added which takes a
KSharedConfig::Ptr as argument. The private ctor, though, only takes a
KSharedConfig::Ptr and the instance method taking a QString argument
uses KSharedConfig::openConfig on the config file name.

The change is source-incompatible in the following situation:

  • kcfgfile arg="true"
  • Singleton = true
  • Inherits is specified

In this situation the previous revision created an instance method with
a QString argument and passed that to the parent constructor. This is
not in accordance with the documentation. Any user of this behavior was
relying on a bug. With this change now the call to the parent
constructor carries a KSharedConfigPtr.

Test Plan

kconfigcompiler tests still pass and a config with singleton
and arg="true" generates the code as I need it

Diff Detail

Repository
R237 KConfig
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 9045.Dec 15 2016, 6:01 PM
graesslin retitled this revision from to Generate an instance with KSharedConfig::Ptr for singleton and arg.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: Frameworks, dfaure, mdawson.
dfaure accepted this revision.Jan 4 2017, 9:19 PM
dfaure edited edge metadata.
This revision is now accepted and ready to land.Jan 4 2017, 9:19 PM
This revision was automatically updated to reflect the committed changes.