File indexing completed on 2024-04-14 04:01:53

0001 /***************************************************************************
0002                           main.cpp  -  description
0003                              -------------------
0004     begin                : mer jui 11 22:27:28 EDT 2001
0005     copyright            : (C) 2001 by Gaël de Chalendar
0006     email                : Gael.de.Chalendar@free.fr
0007 
0008 This is the standard main function of a KDE application simplified for KsirK
0009 
0010  ***************************************************************************/
0011 
0012 /***************************************************************************
0013  *                                                                         *
0014  *   This program is free software; you can redistribute it and/or modify  *
0015  *   it under the terms of the GNU General Public License as published by  *
0016  *   the Free Software Foundation; either either version 2
0017    of the License, or (at your option) any later version.of the License, or     *
0018  *   (at your option) any later version.                                   *
0019  *                                                                         *
0020  ***************************************************************************/
0021 
0022 #include "kgamewin.h"
0023 #include "GameLogic/gameautomaton.h"
0024 #include <KAboutData>
0025 #include <KDBusService>
0026 #include <KCrash>
0027 #include "ksirk_debug.h"
0028 #include <QApplication>
0029 #include <QCommandLineParser>
0030 
0031 #include "../ksirk_version.h"
0032 
0033 int main(int argc, char *argv[])
0034 {
0035   qCDebug(KSIRK_LOG) << "Hello KsirK";
0036 
0037   QApplication app(argc, argv);
0038 
0039   KLocalizedString::setApplicationDomain(QByteArrayLiteral("ksirk"));
0040 
0041   KAboutData aboutData(QStringLiteral("ksirk"),
0042                        i18n("KsirK"),
0043                        QStringLiteral(KSIRK_VERSION_STRING),
0044                        i18n("KsirK - World Domination Strategy Game"),
0045                        KAboutLicense::GPL,
0046                        i18n("(c) 2002-2015, Gaël de Chalendar\n"),
0047                        i18n("For help and user manual, please see\nthe KsirK web site."),
0048                        QStringLiteral("https://apps.kde.org/ksirk"));
0049 
0050   aboutData.addAuthor(i18n("Gaël de Chalendar aka Kleag"),QStringLiteral(), QStringLiteral("kleag@free.fr"));
0051   aboutData.addAuthor(i18n("Nemanja Hirsl"),i18n("Current maintainer"), QStringLiteral("nemhirsl@gmail.com"));
0052   aboutData.addAuthor(i18n("Robin Doer"));
0053   aboutData.addAuthor(i18n("Albert Astals Cid"));
0054   aboutData.addAuthor(i18n("Michal Golunski (Polish translation)"),QStringLiteral(), QStringLiteral("michalgolunski@o2.pl"));
0055   aboutData.addAuthor(i18n("French students of the 'IUP ISI 2007-2008':"));
0056   aboutData.addAuthor(i18n("&nbsp;&nbsp;Anthony Rey<br/>&nbsp;&nbsp;Benjamin Lucas<br/>&nbsp;&nbsp;Benjamin Moreau<br/>&nbsp;&nbsp;Gaël Clouet<br/>&nbsp;&nbsp;Guillaume Pelouas<br/>&nbsp;&nbsp;Joël Marco<br/>&nbsp;&nbsp;Laurent Dang<br/>&nbsp;&nbsp;Nicolas Linard<br/>&nbsp;&nbsp;Vincent Sac"));
0057 
0058   app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksirk")));
0059   KAboutData::setApplicationData(aboutData);
0060   KCrash::initialize();
0061   QCommandLineParser parser;
0062   aboutData.setupCommandLine(&parser);
0063   parser.process(app);
0064   aboutData.processCommandLine(&parser);
0065 
0066   KDBusService service;
0067 
0068   if (app.isSessionRestored())
0069   {
0070       kRestoreMainWindows<Ksirk::KGameWindow>();
0071   }
0072   else
0073   {
0074     qCDebug(KSIRK_LOG) << "Creating main window";
0075     Ksirk::KGameWindow *ksirk = new Ksirk::KGameWindow();
0076     ksirk->show();
0077   }
0078 
0079   app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksirk")));
0080 
0081   qCDebug(KSIRK_LOG) << "Executing app";
0082   return app.exec();
0083 }