File indexing completed on 2022-11-22 15:29:34

0001 /*
0002  * Copyright 2001 Stefan Schimanski <schimmi@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License
0015  * along with this program; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0017  */
0018 
0019 #include "ktimer.h"
0020 #include <KAboutData>
0021 #include <KDBusService>
0022 #include <KLocalizedString>
0023 #include <Kdelibs4ConfigMigrator>
0024 #include <QApplication>
0025 #include <QCommandLineParser>
0026 #include <config-ktimer.h>
0027 
0028 int main(int argc, char **argv)
0029 {
0030     QApplication app(argc, argv);
0031 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0032     /**
0033      * enable high dpi support
0034      */
0035     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
0036 
0037     Kdelibs4ConfigMigrator migrate(QStringLiteral("ktimer"));
0038     migrate.setConfigFiles(QStringList() << QStringLiteral("ktimerrc"));
0039     migrate.migrate();
0040 #endif
0041     KLocalizedString::setApplicationDomain("ktimer");
0042     KAboutData aboutData(QStringLiteral("ktimer"),
0043                          i18n("KTimer"),
0044                          QStringLiteral(KTIMER_VERSION),
0045                          i18n("KDE Timer"),
0046                          KAboutLicense::GPL,
0047                          i18n("(c) 2001, Stefan Schimanski"),
0048                          QStringLiteral("https://utils.kde.org/projects/ktimer/"));
0049     aboutData.addAuthor(i18n("Stefan Schimanski"), QString(), QStringLiteral("schimmi@kde.org"));
0050     QCommandLineParser parser;
0051     KAboutData::setApplicationData(aboutData);
0052     aboutData.setupCommandLine(&parser);
0053     parser.process(app);
0054     aboutData.processCommandLine(&parser);
0055 
0056     app.setQuitOnLastWindowClosed(false);
0057     KDBusService service;
0058 
0059     auto timer = new KTimerPref;
0060     timer->show();
0061 
0062     return app.exec();
0063 }