File: test1main.cpp

package info (click to toggle)
kconfig 5.116.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,080 kB
  • sloc: cpp: 17,783; xml: 73; perl: 63; sh: 14; makefile: 7
file content (27 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
    SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>

    SPDX-License-Identifier: MIT
*/
#include "test1.h"
#include <KConfig>
#include <KConfigGroup>
#include <QGuiApplication>

int main(int argc, char **argv)
{
    QGuiApplication app(argc, argv);
    Q_UNUSED(app);

    {
        KConfig initialConfig(QStringLiteral("examplerc"));
        KConfigGroup group = initialConfig.group(QStringLiteral("MyOptions"));
        group.writeEntry(QStringLiteral("MyString"), QStringLiteral("The String"));
    }
    Test1 *t = new Test1(QString(), QString());

    bool ok = t->myString() == QLatin1String("The String");

    delete t;
    return ok ? 0 : 1;
}