From c1980dbc51c9aa2770d09850e69529ea2211924b Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 16 Mar 2014 23:30:59 +0100 Subject: Add KCoreConfigSkeleton::read() which doesn't call reparseConfiguration. Call it from generated singletons, since the constructor creates a KConfig from a filename, which already loads from disk. This removes the need for using DelayedParsing. REVIEW: 116845 --- autotests/kconfig_compiler/test1main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'autotests/kconfig_compiler/test1main.cpp') diff --git a/autotests/kconfig_compiler/test1main.cpp b/autotests/kconfig_compiler/test1main.cpp index d7dc038d..8ab7838c 100644 --- a/autotests/kconfig_compiler/test1main.cpp +++ b/autotests/kconfig_compiler/test1main.cpp @@ -20,12 +20,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "test1.h" #include +#include +#include int main(int argc, char **argv) { QGuiApplication app(argc, argv); Q_UNUSED(app); + + { + KConfig initialConfig(QLatin1String("examplerc")); + KConfigGroup group = initialConfig.group(QLatin1String("MyOptions")); + group.writeEntry(QLatin1String("MyString"), QStringLiteral("The String")); + } Test1 *t = new Test1(QString(), QString()); + + bool ok = t->myString() == QLatin1String("The String"); + delete t; - return 0; + return ok ? 0 : 1; } -- cgit v1.2.1