From cd4e6504dfbdface00037625f0cedda511e6d839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 16 Nov 2016 14:59:28 +0100 Subject: Generate an instance with KSharedConfig::Ptr for singleton and arg 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. This provides full API compatibility and at the same time allows to use KSharedConfig in addition to the arg name based variant. Test Plan: kconfigcompiler tests still pass and a config with singleton and arg="true" generates the code as I need it Reviewers: #frameworks Differential Revision: https://phabricator.kde.org/D3386 --- autotests/kconfig_compiler/test8main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'autotests/kconfig_compiler/test8main.cpp') diff --git a/autotests/kconfig_compiler/test8main.cpp b/autotests/kconfig_compiler/test8main.cpp index b8fcc492..9843df72 100644 --- a/autotests/kconfig_compiler/test8main.cpp +++ b/autotests/kconfig_compiler/test8main.cpp @@ -21,6 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "test8a.h" #include "test8b.h" +#include "test8c.h" #include int main(int argc, char **argv) @@ -30,6 +31,8 @@ int main(int argc, char **argv) Test8a *config1 = new Test8a(KSharedConfig::openConfig(QString())); Test8a *config2 = new Test8a(); Test8b::self(); + Test8c::instance(KSharedConfig::openConfig(QString())); + Test8c::self(); delete config1; delete config2; return 0; -- cgit v1.2.1