File indexing completed on 2023-09-24 08:14:13

0001 /*
0002     This file is part of Killbots.
0003 
0004     SPDX-FileCopyrightText: 2006-2009 Parker Coates <coates@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #include "mainwindow.h"
0010 #include "killbots_version.h"
0011 
0012 #include <KLocalizedString>
0013 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0014 #include <Kdelibs4ConfigMigrator>
0015 #endif
0016 #include <QApplication>
0017 #include <KAboutData>
0018 #include <KCrash>
0019 #include <QCommandLineParser>
0020 #include <KDBusService>
0021 
0022 int main(int argc, char **argv)
0023 {
0024     // Fixes blurry icons with fractional scaling
0025 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0026     QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
0027 #endif
0028     QApplication app(argc, argv);
0029 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0030     Kdelibs4ConfigMigrator migrate(QStringLiteral("killbots"));
0031     migrate.setConfigFiles(QStringList() << QStringLiteral("killbotsrc"));
0032     migrate.setUiFiles(QStringList() << QStringLiteral("killbotsui.rc"));
0033     migrate.migrate();
0034 #endif
0035 
0036     KLocalizedString::setApplicationDomain("killbots");
0037 
0038     KAboutData about(QStringLiteral("killbots"), i18n("Killbots"), QStringLiteral(KILLBOTS_VERSION_STRING));
0039     about.setShortDescription(i18n("A KDE game of killer robots and teleportation."));
0040     about.setLicense(KAboutLicense::GPL_V2);
0041     about.setCopyrightStatement(i18n("© 2006-2009, Parker Coates"));
0042     about.addAuthor(i18n("Parker Coates"), i18n("Developer"), QStringLiteral("coates@kde.org"));
0043     about.addCredit(i18n("Mark Rae"), i18n("Author of Gnome Robots. Invented safe teleports, pushing junkheaps and fast robots."), QLatin1String(""), QStringLiteral("https://wiki.gnome.org/Apps/Robots"));
0044     about.setHomepage(QStringLiteral("https://apps.kde.org/killbots"));
0045 
0046     QCommandLineParser parser;
0047     KAboutData::setApplicationData(about);
0048     KCrash::initialize();
0049     about.setupCommandLine(&parser);
0050     parser.process(app);
0051     about.processCommandLine(&parser);
0052 
0053     KDBusService service;
0054 
0055     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("killbots")));
0056 
0057     Killbots::MainWindow *mainWindow = new Killbots::MainWindow;
0058     mainWindow->show();
0059 
0060     return app.exec();
0061 }