main.cpp 1.72 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   SPDX-FileCopyrightText: 2019-2022 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3

4
   SPDX-License-Identifier: GPL-2.0-or-later
Laurent Montel's avatar
Laurent Montel committed
5
6
*/

7
8
#include "refreshsettingsassistant.h"

9
#include <Akonadi/ControlGui>
Laurent Montel's avatar
Laurent Montel committed
10

11
#include <KAboutData>
Laurent Montel's avatar
Laurent Montel committed
12
13
14
15
16
#include <QApplication>

#include <KDBusService>
#include <KLocalizedString>

Laurent Montel's avatar
Laurent Montel committed
17
#include <KCrash>
Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
#include <QCommandLineParser>
#include <QIcon>

int main(int argc, char **argv)
{
23
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Laurent Montel's avatar
Laurent Montel committed
24
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
25
    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
26
#endif
Laurent Montel's avatar
Laurent Montel committed
27
    QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
Laurent Montel's avatar
Laurent Montel committed
28
29
30
31
32
33
34
35
    QApplication app(argc, argv);
    KLocalizedString::setApplicationDomain("kmail-refresh-settings");
    KCrash::initialize();
    KAboutData aboutData(QStringLiteral("kmail-refresh-settings"),
                         i18n("KMail Assistant for refreshing settings"),
                         QStringLiteral("0.1"),
                         i18n("KMail Assistant for refreshing settings"),
                         KAboutLicense::LGPL,
Laurent Montel's avatar
Laurent Montel committed
36
                         i18n("(c) 2019-2022 Laurent Montel <montel@kde.org>"));
Laurent Montel's avatar
Laurent Montel committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    aboutData.addAuthor(i18n("Laurent Montel"), i18n("Author"), QStringLiteral("montel@kde.org"));

    app.setOrganizationDomain(QStringLiteral("kde.org"));
    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kontact")));
    QCommandLineParser parser;
    KAboutData::setApplicationData(aboutData);

    aboutData.setupCommandLine(&parser);
    parser.process(app);
    aboutData.processCommandLine(&parser);

    KDBusService service(KDBusService::Unique);

    Akonadi::ControlGui::start(nullptr);

52
53
    RefreshSettingsAssistant dlg(nullptr);
    dlg.show();
Laurent Montel's avatar
Laurent Montel committed
54
55
    return app.exec();
}