File indexing completed on 2024-05-05 08:09:01

0001 /*
0002     SPDX-FileCopyrightText: 2008 Ian Wadham <iandw.au@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include <QApplication>
0008 #include <QCommandLineParser>
0009 
0010 #include <KAboutData>
0011 #include <KCrash>
0012 #include <KLocalizedString>
0013 
0014 #include "kubrick.h"
0015 #include "kubrick_version.h"
0016 
0017 int main(int argc, char **argv)
0018 {
0019     QApplication app(argc, argv);
0020 
0021     KLocalizedString::setApplicationDomain("kubrick");
0022 
0023     KAboutData about (QStringLiteral("kubrick"), i18n ("Kubrick"),
0024             QStringLiteral(KUBRICK_VERSION_STRING),
0025             i18n ("A game based on Rubik's Cube (TM)"),
0026             KAboutLicense::GPL,
0027             i18n ("&copy; 2008 Ian Wadham"),
0028             QString(),
0029             QStringLiteral("https://apps.kde.org/kubrick") );
0030     about.addAuthor (i18n ("Ian Wadham"), i18n ("Author"),
0031                              QStringLiteral("iandw.au@gmail.com"));
0032 
0033     KAboutData::setApplicationData(about);
0034     QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kubrick")));
0035 
0036     KCrash::initialize();
0037 
0038     QCommandLineParser parser;
0039     about.setupCommandLine(&parser);
0040     parser.process(app);
0041     about.processCommandLine(&parser);
0042 
0043     Kubrick * mainWindow = nullptr;
0044 
0045     if (app.isSessionRestored ()) {
0046         kRestoreMainWindows<Kubrick>();
0047     }
0048     else {
0049         // No interrupted session ... just start up normally.
0050 
0051         /// @todo do something with the command line args here
0052 
0053         mainWindow = new Kubrick ();
0054         mainWindow->show ();
0055     }
0056 
0057     // MainWindow has WDestructiveClose flag by default, so
0058     // it will delete itself.
0059     return app.exec ();
0060 }