File indexing completed on 2023-05-30 12:30:43

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 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0024 #include <Kdelibs4ConfigMigrator>
0025 #endif
0026 #include <QApplication>
0027 #include <QCommandLineParser>
0028 #include <config-ktimer.h>
0029 
0030 int main(int argc, char **argv)
0031 {
0032     QApplication app(argc, argv);
0033 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0034     /**
0035      * enable high dpi support
0036      */
0037     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
0038 
0039     Kdelibs4ConfigMigrator migrate(QStringLiteral("ktimer"));
0040     migrate.setConfigFiles(QStringList() << QStringLiteral("ktimerrc"));
0041     migrate.migrate();
0042 #endif
0043     KLocalizedString::setApplicationDomain("ktimer");
0044     KAboutData aboutData(QStringLiteral("ktimer"),
0045                          i18n("KTimer"),
0046                          QStringLiteral(KTIMER_VERSION),
0047                          i18n("KDE Timer"),
0048                          KAboutLicense::GPL,
0049                          i18n("(c) 2001, Stefan Schimanski"),
0050                          QStringLiteral("https://utils.kde.org/projects/ktimer/"));
0051     aboutData.addAuthor(i18n("Stefan Schimanski"), QString(), QStringLiteral("schimmi@kde.org"));
0052     QCommandLineParser parser;
0053     KAboutData::setApplicationData(aboutData);
0054     aboutData.setupCommandLine(&parser);
0055     parser.process(app);
0056     aboutData.processCommandLine(&parser);
0057 
0058     app.setQuitOnLastWindowClosed(false);
0059     KDBusService service;
0060 
0061     auto timer = new KTimerPref;
0062     timer->show();
0063 
0064     return app.exec();
0065 }