File indexing completed on 2024-09-08 03:46:54
0001 /* 0002 SPDX-FileCopyrightText: 1999-2006 Éric Bischoff <ebischoff@nerim.net> 0003 SPDX-FileCopyrightText: 2007 Albert Astals Cid <aacid@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #include <KLocalizedString> 0009 0010 #include "toplevel.h" 0011 #include <KAboutData> 0012 #include <KCrash> 0013 #include <KDBusService> 0014 #include <QApplication> 0015 #include <QCommandLineParser> 0016 #include <QDir> 0017 0018 #include "ktuberling_version.h" 0019 0020 // Main function 0021 int main(int argc, char *argv[]) 0022 { 0023 QApplication app(argc, argv); 0024 0025 KLocalizedString::setApplicationDomain(QByteArrayLiteral("ktuberling")); 0026 0027 KAboutData aboutData( QStringLiteral("ktuberling"), i18n("KTuberling"), 0028 QStringLiteral(KTUBERLING_VERSION_STRING), 0029 i18n("Potato game for kids"), 0030 KAboutLicense::GPL, 0031 i18n("(c) 1999-2009, The KTuberling Developers")); 0032 aboutData.addAuthor(i18n("Albert Astals Cid"), i18n("Maintainer"), QStringLiteral("aacid@kde.org")); 0033 aboutData.addAuthor(i18n("Éric Bischoff"), i18n("Former Developer"), QStringLiteral("ebischoff@nerim.net")); 0034 aboutData.addCredit(i18n("John Calhoun"), i18n("Original concept and artwork")); 0035 aboutData.addCredit(i18n("Agnieszka Czajkowska"), i18n("New artwork"), QStringLiteral("agnieszka@imagegalaxy.de")); 0036 aboutData.addCredit(i18n("Bas Willems"), i18n("New artwork"), QStringLiteral("cybersurfer@euronet.nl")); 0037 aboutData.addCredit(i18n("Roger Larsson"), i18n("Sounds tuning"), QStringLiteral("roger.larsson@norran.net")); 0038 aboutData.addCredit(i18n("Dolores Almansa"), i18n("New artwork"), QStringLiteral("dolores.almansa@corazondemaria.org")); 0039 aboutData.setHomepage(QStringLiteral("https://apps.kde.org/ktuberling")); 0040 0041 KAboutData::setApplicationData(aboutData); 0042 QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("ktuberling"))); 0043 0044 KCrash::initialize(); 0045 0046 QCommandLineParser parser; 0047 parser.addPositionalArgument(QStringLiteral("tuberling-file"), i18n("Potato to open")); 0048 aboutData.setupCommandLine(&parser); 0049 parser.process(app); 0050 aboutData.processCommandLine(&parser); 0051 0052 KDBusService service; 0053 TopLevel *toplevel=nullptr; 0054 0055 if (app.isSessionRestored()) 0056 kRestoreMainWindows<TopLevel>(); 0057 else { 0058 toplevel = new TopLevel(); 0059 toplevel->show(); 0060 if (!parser.positionalArguments().isEmpty()) 0061 toplevel->open(QUrl::fromUserInput(parser.positionalArguments().at(0), QDir::currentPath())); 0062 0063 } 0064 0065 return app.exec(); 0066 }