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/test4main.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'autotests/kconfig_compiler/test4main.cpp') diff --git a/autotests/kconfig_compiler/test4main.cpp b/autotests/kconfig_compiler/test4main.cpp index 8f1c1ec8..1df7cc5e 100644 --- a/autotests/kconfig_compiler/test4main.cpp +++ b/autotests/kconfig_compiler/test4main.cpp @@ -21,12 +21,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "test4.h" #include +#include +#include int main(int argc, char **argv) { QGuiApplication app(argc, argv); Q_UNUSED(app); + { + KConfig initialConfig(QLatin1String("test4rc")); + KConfigGroup group = initialConfig.group(QLatin1String("Foo")); + group.writeEntry(QLatin1String("foo bar"), QStringLiteral("Value")); + } Test4 *t = Test4::self(); + bool ok = QFile::exists(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/test4rc"); + if (!ok) { + qWarning() << "config file was not created!"; + } + if (t->fooBar() != QStringLiteral("Value")) { + qWarning() << "wrong value for foo bar:" << t->fooBar(); + } delete t; - return 0; + return ok ? 0 : 1; } -- cgit v1.2.1