File indexing completed on 2024-05-12 03:54:20

0001 /*
0002     SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 #include "test1.h"
0007 #include <KConfig>
0008 #include <KConfigGroup>
0009 #include <QGuiApplication>
0010 
0011 int main(int argc, char **argv)
0012 {
0013     QGuiApplication app(argc, argv);
0014     Q_UNUSED(app);
0015 
0016     {
0017         KConfig initialConfig(QStringLiteral("examplerc"));
0018         KConfigGroup group = initialConfig.group(QStringLiteral("MyOptions"));
0019         group.writeEntry(QStringLiteral("MyString"), QStringLiteral("The String"));
0020     }
0021     Test1 *t = new Test1(QString(), QString());
0022 
0023     bool ok = t->myString() == QLatin1String("The String");
0024 
0025     delete t;
0026     return ok ? 0 : 1;
0027 }