File indexing completed on 2024-04-28 07:51:31
0001 /* 0002 SPDX-FileCopyrightText: 2008-2009 Stefan Majewsky <majewsky@gmx.net> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "mainwindow.h" 0008 #include "settings.h" 0009 #include "kdiamond_version.h" 0010 0011 #include <ctime> 0012 0013 #include <KAboutData> 0014 #include <KCrash> 0015 #include <KLocalizedString> 0016 #include <KGameDifficulty> 0017 #include <KDBusService> 0018 0019 #include <QApplication> 0020 #include <QCommandLineParser> 0021 #include <QStandardPaths> 0022 0023 int main(int argc, char **argv) 0024 { 0025 QApplication app(argc, argv); 0026 0027 KLocalizedString::setApplicationDomain("kdiamond"); 0028 KAboutData about(QStringLiteral("kdiamond"), i18nc("The application's name", "KDiamond"), 0029 QStringLiteral(KDIAMOND_VERSION_STRING), 0030 i18n("KDiamond, a three-in-a-row game."), 0031 KAboutLicense::GPL, i18n("(C) 2008-2010 Stefan Majewsky and others"), 0032 QString(), 0033 QStringLiteral("https://apps.kde.org/kdiamond")); 0034 about.addAuthor(i18n("Stefan Majewsky"), i18n("Original author and current maintainer"), QStringLiteral("majewsky@gmx.net")); 0035 about.addAuthor(i18n("Paul Bunbury"), i18n("Gameplay refinement"), QStringLiteral("happysmileman@googlemail.com")); 0036 about.addCredit(i18n("Eugene Trounev"), i18n("Default theme"), QStringLiteral("eugene.trounev@gmail.com")); 0037 about.addCredit(i18n("Felix Lemke"), i18n("Classic theme"), QStringLiteral("lemke.felix@ages-skripte.org")); 0038 about.addCredit(i18n("Jeffrey Kelling"), i18n("Technical consultant"), QStringLiteral("kelling.jeffrey@ages-skripte.org")); 0039 QCommandLineParser parser; 0040 KAboutData::setApplicationData(about); 0041 KCrash::initialize(); 0042 about.setupCommandLine(&parser); 0043 parser.process(app); 0044 about.processCommandLine(&parser); 0045 0046 app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdiamond"))); 0047 0048 //resource directory for KNewStuff2 (this call causes the directory to be created; its existence is necessary for the downloader) 0049 QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/themes/"); 0050 0051 KGameDifficulty::global()->addStandardLevelRange( 0052 KGameDifficultyLevel::VeryEasy, 0053 KGameDifficultyLevel::VeryHard 0054 ); 0055 KDBusService service; 0056 // see if we are starting with session management 0057 if (app.isSessionRestored()) { 0058 kRestoreMainWindows<MainWindow>(); 0059 } else { 0060 MainWindow *window = new MainWindow; 0061 window->show(); 0062 } 0063 return app.exec(); 0064 }