File indexing completed on 2025-01-05 05:14:39

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 // application header
0008 #include "commandargsparser.h"
0009 #include "dialogs/changedfilesdialog.h"
0010 
0011 // KF headers
0012 #include <KAboutData>
0013 #include <KCrash>
0014 #include <KDBusService>
0015 #include <KLocalizedString>
0016 
0017 // Qt headers
0018 #include <QApplication>
0019 #include <QCommandLineParser>
0020 #include <QIcon>
0021 
0022 int main(int argc, char **argv)
0023 {
0024 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0025     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
0026     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
0027 #endif
0028     QApplication application(argc, argv);
0029 
0030     KLocalizedString::setApplicationDomain("kommit");
0031     KCrash::initialize();
0032 
0033     KAboutData aboutData(QStringLiteral("kommit"),
0034                          i18n("Kommit"),
0035                          QStringLiteral(GK_VERSION),
0036                          i18n("Git client gui for KDE"),
0037                          KAboutLicense::GPL_V3,
0038                          i18n("Copyright 2021-2023, Hamed Masafi <hamed.masafi@gmail.com>"));
0039 
0040     aboutData.addAuthor(i18n("Hamed Masafi"), i18n("Author"), QStringLiteral("hamed.masafi@gmail.com"));
0041     aboutData.addCredit(i18n("Laurent Montel"), i18n("Bug fixing"), QStringLiteral("montel@kde.org"));
0042     aboutData.setDesktopFileName(QStringLiteral("org.kde.kommit"));
0043 
0044     KAboutData::setApplicationData(aboutData);
0045     application.setWindowIcon(QIcon::fromTheme(QStringLiteral("kommit")));
0046 
0047     QCommandLineParser parser;
0048     aboutData.setupCommandLine(&parser);
0049 
0050     parser.process(application);
0051     aboutData.processCommandLine(&parser);
0052 
0053     KDBusService appDBusService(KDBusService::Multiple | KDBusService::NoExitOnFailure);
0054 
0055     CommandArgsParser p;
0056     const auto w = p.run(application.arguments());
0057     if (w.type == ExecApp)
0058         return application.exec();
0059 
0060     return w.code;
0061 }