Warning, file /games/kblackbox/src/main.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     KBlackBox - A simple game inspired by an emacs module
0003 
0004     SPDX-FileCopyrightText: 1999-2000 Robert Cimrman <cimrman3@students.zcu.cz>
0005     SPDX-FileCopyrightText: 2007 Nicolas Roffet <nicolas-kde@roffet.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 
0011 
0012 
0013 #include <KLocalizedString>
0014 
0015 #include <KAboutData>
0016 #include <QApplication>
0017 #include <QCommandLineParser>
0018 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0019 #include <Kdelibs4ConfigMigrator>
0020 #endif
0021 #include <KCrash>
0022 
0023 #include "kbbmainwindow.h"
0024 #include "kblackbox_version.h"
0025 #include <KDBusService>
0026 
0027 
0028 int main( int argc, char **argv )
0029 {
0030     // Fixes blurry icons with fractional scaling
0031 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0032     QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
0033 #endif
0034     
0035     QApplication application(argc, argv);
0036 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0037     Kdelibs4ConfigMigrator migrate(QStringLiteral("kblackbox"));
0038     migrate.setConfigFiles(QStringList() << QStringLiteral("kblackboxrc"));
0039     migrate.setUiFiles(QStringList() << QStringLiteral("kblackboxui.rc"));
0040     migrate.migrate();
0041 #endif
0042     KLocalizedString::setApplicationDomain("kblackbox");
0043     KAboutData aboutData( QStringLiteral("kblackbox"),
0044                           i18n("KBlackBox"),
0045                           QStringLiteral(KBLACKBOX_VERSION_STRING),
0046                           i18n("Find the balls hidden in the black box by shooting laser beams!"),
0047                           KAboutLicense::GPL,
0048                           i18n("(c) 2007, Nicolas Roffet\n(c) 1999-2000, Robert Cimrman"),
0049                           QStringLiteral("https://apps.kde.org/kblackbox"));
0050     aboutData.addAuthor(i18n("Nicolas Roffet"),i18n("Developer of version 0.4."), QStringLiteral("nicolas-kde@roffet.com"));
0051     aboutData.addAuthor(i18n("Robert Cimrman"),i18n("Original developer"), QStringLiteral("cimrman3@students.zcu.cz"));
0052     aboutData.addCredit(i18n("Johann Ollivier Lapeyre"), i18n("Artist"), QStringLiteral("johann.ollivierlapeyre@gmail.com"));
0053     QCommandLineParser parser;
0054     KAboutData::setApplicationData(aboutData);
0055     KCrash::initialize();
0056     aboutData.setupCommandLine(&parser);
0057     parser.process(application);
0058     aboutData.processCommandLine(&parser);
0059     KDBusService service;
0060 
0061     application.setWindowIcon(QIcon::fromTheme(QStringLiteral("kblackbox")));
0062 
0063 
0064     if (application.isSessionRestored())
0065         kRestoreMainWindows<KBBMainWindow>();
0066     else {
0067         KBBMainWindow *mainWindow = new KBBMainWindow;
0068         mainWindow->show();
0069     }
0070 
0071     return application.exec();
0072 }