diff options
author | David Faure <faure@kde.org> | 2014-03-16 23:30:59 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2014-03-23 23:00:03 +0100 |
commit | c1980dbc51c9aa2770d09850e69529ea2211924b (patch) | |
tree | 2bbccf3cdebbd6d1149eb1ae615c832570cfa000 /autotests/kconfig_compiler/test1main.cpp | |
parent | 41ccd7bcd61c478a4243165b1df0c48e2ecad0df (diff) | |
download | kconfig-c1980dbc51c9aa2770d09850e69529ea2211924b.tar.gz kconfig-c1980dbc51c9aa2770d09850e69529ea2211924b.tar.bz2 |
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
Diffstat (limited to 'autotests/kconfig_compiler/test1main.cpp')
-rw-r--r-- | autotests/kconfig_compiler/test1main.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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 <QGuiApplication> +#include <KConfig> +#include <KConfigGroup> 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; } |