main.cpp 2.42 KB
Newer Older
1 2 3
/*
 *  main.cpp
 *  Program:  kalarm
David Jarvie's avatar
David Jarvie committed
4
 *  Copyright © 2001-2016 by David Jarvie <djarvie@kde.org>
5 6 7 8 9
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
David Jarvie's avatar
David Jarvie committed
10 11 12 13 14 15
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU General Public License for more details.
 *
David Jarvie's avatar
David Jarvie committed
16 17 18
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 20 21 22
 */

#include "kalarm.h"

23
#include "kalarmapp.h"
David Jarvie's avatar
David Jarvie committed
24
#include "kalarm_debug.h"
25

Laurent Montel's avatar
Laurent Montel committed
26
#include <kalarmcal/version.h>
David Jarvie's avatar
David Jarvie committed
27

David Jarvie's avatar
David Jarvie committed
28
#include <KAboutData>
Laurent Montel's avatar
Laurent Montel committed
29
#include <KLocalizedString>
David Jarvie's avatar
David Jarvie committed
30 31

#include <QDir>
32

33
#include <stdlib.h>
34

David Jarvie's avatar
David Jarvie committed
35
#define PROGRAM_NAME "kalarm"
36

David Jarvie's avatar
Tidy  
David Jarvie committed
37
int main(int argc, char* argv[])
38
{
David Jarvie's avatar
David Jarvie committed
39 40 41
    KAlarmApp* app = KAlarmApp::create(argc, argv);
    QStringList args = app->arguments();
    app->setAttribute(Qt::AA_UseHighDpiPixmaps, true);
Laurent Montel's avatar
Laurent Montel committed
42
    app->setAttribute(Qt::AA_EnableHighDpiScaling);
David Jarvie's avatar
David Jarvie committed
43

Laurent Montel's avatar
Laurent Montel committed
44
    KLocalizedString::setApplicationDomain("kalarm");
David Jarvie's avatar
David Jarvie committed
45 46 47 48 49 50 51
    KAboutData aboutData(QStringLiteral(PROGRAM_NAME), i18n("KAlarm"),
                         QStringLiteral(KALARM_VERSION),
                         i18n("Personal alarm message, command and email scheduler for KDE"),
                         KAboutLicense::GPL,
                         ki18n("Copyright 2001-%1, David Jarvie").subs(2016).toString(), QString(),
                         QStringLiteral("http://www.astrojar.org.uk/kalarm"));
    aboutData.addAuthor(i18n("David Jarvie"), i18n("Author"), QStringLiteral("djarvie@kde.org"));
52
    aboutData.setOrganizationDomain("kde.org");
David Jarvie's avatar
David Jarvie committed
53
    KAboutData::setApplicationData(aboutData);
54

Laurent Montel's avatar
Laurent Montel committed
55
    qCDebug(KALARM_LOG) << "initialising";
David Jarvie's avatar
David Jarvie committed
56 57

    app->activate(args, QDir::currentPath());
58 59
    app->restoreSession();
    return app->exec();
60
}
61 62 63 64 65 66 67 68 69

namespace KAlarm
{

/******************************************************************************
* Return the current KAlarm version number.
*/
int Version()
{
70 71
    static int version = 0;
    if (!version)
Laurent Montel's avatar
Laurent Montel committed
72
        version = KAlarmCal::getVersionNumber(QStringLiteral(KALARM_VERSION));
73
    return version;
74 75 76
}

} // namespace KAlarm
77 78

// vim: et sw=4: