File indexing completed on 2022-09-27 12:25:41

0001 /*
0002     SPDX-FileCopyrightText: 2001-2011 Anne-Marie Mahfouf <annma@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 /*****************************************************/
0008 /* Please save with utf8 encoding, thanks  */
0009 /*****************************************************/
0010 #include <QApplication>
0011 #include <QCommandLineParser>
0012 
0013 #include <KLocalizedString>
0014 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0015 #include <Kdelibs4ConfigMigrator>
0016 #endif
0017 #include <KCrash>
0018 #include <KAboutData>
0019 #include "klettres.h"
0020 #include "klettres_version.h"
0021 
0022 int main(int argc, char **argv)
0023 {
0024     QApplication app(argc, argv);
0025 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0026     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
0027 #endif
0028     KLocalizedString::setApplicationDomain("klettres");
0029 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0030     QStringList configFiles;
0031     QStringList rcFiles;
0032     configFiles << QStringLiteral("klettresrc");
0033     rcFiles << QStringLiteral("klettresui.rc");
0034     Kdelibs4ConfigMigrator migrator(QStringLiteral("klettres"));
0035     migrator.setConfigFiles(configFiles);
0036     migrator.setUiFiles(rcFiles);
0037     migrator.migrate();
0038 #endif
0039 
0040     KAboutData about(QStringLiteral("klettres"), i18n("KLettres"), QStringLiteral(KLETTRES_VERSION_STRING), i18n("KLettres helps a very young child or an adult learning \n"
0041                                                                                                                  "a new language by associating sounds and \n"
0042                                                                                                                  "letters in this language.\n\n"
0043                                                                                                                  "25 languages are available."),
0044                      KAboutLicense::GPL, i18n("(C) 2001-2011 Anne-Marie Mahfouf"),QString(), QStringLiteral("https://edu.kde.org/klettres"), QStringLiteral("submit@bugs.kde.org"));
0045     about.addAuthor( i18n("Anne-Marie Mahfouf"), QString(), QStringLiteral("annma AT kde DOT org"), QStringLiteral("https://annma.blogspot.com"), QStringLiteral("annma"));
0046     about.addCredit(i18n("Marc Cheng"),
0047                     i18n("Kids and grown-up oxygen icons"), QStringLiteral("bdgraue AT web DOT de"));
0048     about.addCredit(i18n("Danny Allen"),
0049                     i18n("SVG background pictures"), QStringLiteral("dannya40uk AT yahoo DOT co DOT uk"));
0050     about.addCredit(i18n("Robert Gogolok"),
0051                     i18n("Support and coding guidance"), QStringLiteral("mail AT robert-gogolok DOT de"));
0052     about.addCredit(i18n("Peter Hedlund"),
0053                     i18n("Code for generating special characters' icons"), QStringLiteral("peter DOT hedlund AT kdemail DOT net"));
0054     about.addCredit(i18n("Waldo Bastian"),
0055                     i18n("Port to KConfig XT, coding help"), QStringLiteral("bastian AT kde DOT org"));
0056     about.addCredit(i18n("Pino Toscano"),
0057                     i18n("Code cleaning, Theme class"), QStringLiteral("toscano DOT pino AT tiscali DOT it"));
0058     about.addCredit(i18n("Michael Goettsche"),
0059                     i18n("Timer setting widgets"), QStringLiteral("michael.goettsche AT kdemail DOT net"));
0060     about.addCredit(i18n("Laurent Navet"),
0061                     i18n("Port to KDE Frameworks 5"), QStringLiteral("laurent DOT navet+klettres AT gmail DOT com"));
0062     QCommandLineParser parser;
0063     KAboutData::setApplicationData(about);
0064     about.setupCommandLine(&parser);
0065     parser.process(app);
0066     about.processCommandLine(&parser);
0067 
0068     app.setApplicationName(QStringLiteral("klettres"));
0069     app.setApplicationVersion(QStringLiteral(KLETTRES_VERSION_STRING));
0070     app.setOrganizationDomain(QStringLiteral("kde.org"));
0071 
0072     KCrash::initialize();
0073 
0074     // see if we are starting with session management
0075     if (app.isSessionRestored()) {
0076         kRestoreMainWindows<KLettres>();
0077     } else {
0078         // no session.. just start up normally
0079         if (parser.positionalArguments().isEmpty()) {
0080             KLettres *widget = new KLettres;
0081             widget->show();
0082         } else {
0083             int i = 0;
0084             for (; i < parser.positionalArguments().count(); i++) {
0085                 KLettres *widget = new KLettres;
0086                 widget->show();
0087             }
0088         }
0089     }
0090 
0091     return app.exec();
0092 }
0093