File indexing completed on 2021-12-23 10:45:21

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 
0020 
0021 #include <KAboutData>
0022 #include <QApplication>
0023 #include <KLocalizedString>
0024 #include <QCommandLineParser>
0025 #include <Kdelibs4ConfigMigrator>
0026 #include <KDBusService>
0027 #include "ktimer.h"
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"), i18n("KTimer"),
0045                           QStringLiteral(KTIMER_VERSION), i18n("KDE Timer"), KAboutLicense::GPL,
0046                           i18n("(c) 2001, Stefan Schimanski"),
0047                           QStringLiteral("https://utils.kde.org/projects/ktimer/"));
0048     aboutData.addAuthor(i18n("Stefan Schimanski"),QString(), QStringLiteral("schimmi@kde.org"));
0049     QCommandLineParser parser;
0050     KAboutData::setApplicationData(aboutData);
0051     aboutData.setupCommandLine(&parser);
0052     parser.process(app);
0053     aboutData.processCommandLine(&parser);
0054 
0055     app.setQuitOnLastWindowClosed( false );
0056     KDBusService service;
0057 
0058     auto timer = new KTimerPref;
0059     timer->show();
0060 
0061     return app.exec();
0062 }