main.cpp 3.69 KB
Newer Older
Frederik Schwarzer's avatar
Frederik Schwarzer committed
1 2
/***************************************************************************
 *   KShisen - A japanese game similar to mahjongg                         *
3 4
 *   Copyright 1997  Mario Weilguni <mweilguni@sime.com>                   *
 *   Copyright 2002-2004  Dave Corrie <kde@davecorrie.com>                 *
Frederik Schwarzer's avatar
Frederik Schwarzer committed
5
 *   Copyright 2009,2010  Frederik Schwarzer <schwarzer@kde.org>           *
Frederik Schwarzer's avatar
Frederik Schwarzer committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   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.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 ***************************************************************************/
20

Frederik Schwarzer's avatar
Frederik Schwarzer committed
21 22 23
// Qt
#include <QApplication>
#include <QCommandLineParser>
24

Frederik Schwarzer's avatar
Frederik Schwarzer committed
25
// KDE
Raymond Wooninck's avatar
Raymond Wooninck committed
26
#include <KAboutData>
Frederik Schwarzer's avatar
Frederik Schwarzer committed
27
#include <KCrash>
Frederik Schwarzer's avatar
Frederik Schwarzer committed
28
#include <KDBusService>
Raymond Wooninck's avatar
Raymond Wooninck committed
29
#include <KLocalizedString>
30
#include <Kdelibs4ConfigMigrator>
Frederik Schwarzer's avatar
Frederik Schwarzer committed
31 32 33

// KShisen
#include "app.h"
Frederik Schwarzer's avatar
Frederik Schwarzer committed
34
#include "debug.h"
Frederik Schwarzer's avatar
Frederik Schwarzer committed
35

Frederik Schwarzer's avatar
Frederik Schwarzer committed
36
Q_LOGGING_CATEGORY(KSHISEN_LOG, "log_kshisen")
Jaison Lee's avatar
Jaison Lee committed
37
static const char description[] = I18N_NOOP("A KDE game similar to Mahjongg");
38

39
int main(int argc, char ** argv)
40
{
Laurent Montel's avatar
Laurent Montel committed
41 42
    QApplication a(argc, argv);

Laurent Montel's avatar
Laurent Montel committed
43
    // Migrate pre-existing (4.x) configuration
44 45 46
    Kdelibs4ConfigMigrator migrate(QStringLiteral("kshisen"));
    migrate.setConfigFiles(QStringList() << QStringLiteral("kshisenrc"));
    migrate.setUiFiles(QStringList() << QStringLiteral("kshisenui.rc"));
Laurent Montel's avatar
Laurent Montel committed
47 48
    migrate.migrate();

49
    KLocalizedString::setApplicationDomain("kshisen");
Frederik Schwarzer's avatar
Frederik Schwarzer committed
50

Frederik Schwarzer's avatar
Frederik Schwarzer committed
51
    KAboutData aboutData(QStringLiteral("kshisen"), i18n("Shisen-Sho"), QStringLiteral("1.9+ #20"),
Frederik Schwarzer's avatar
Frederik Schwarzer committed
52
                         i18n(description), KAboutLicense::GPL, i18n("(c) 1997, Mario Weilguni"));
53 54 55 56 57 58
    aboutData.setHomepage(QStringLiteral("http://games.kde.org/kshisen"));
    aboutData.addAuthor(i18n("Frederik Schwarzer"), i18n("Current Maintainer"), QStringLiteral("schwarzer@kde.org"));
    aboutData.addAuthor(i18n("Dave Corrie"), i18n("Former Maintainer"), QStringLiteral("kde@davecorrie.com"));
    aboutData.addAuthor(i18n("Mario Weilguni"), i18n("Original Author"), QStringLiteral("mweilguni@sime.com"));
    aboutData.addCredit(i18n("Mauricio Piacentini"), i18n("KMahjonggLib integration for KDE4"), QStringLiteral("mauricio@tabuleiro.com"));
    aboutData.addCredit(i18n("Jason Lane"), i18n("Added 'tiles removed' counter<br/>Tile smooth-scaling and window resizing"), QStringLiteral("jglane@btopenworld.com"));
Raymond Wooninck's avatar
Raymond Wooninck committed
59 60
    aboutData.addCredit(i18n("Thanks also to everyone who should be listed here but is not!"));
    KAboutData::setApplicationData(aboutData);
Frederik Schwarzer's avatar
Frederik Schwarzer committed
61
    KCrash::initialize();
Frederik Schwarzer's avatar
Frederik Schwarzer committed
62 63

    QCommandLineParser parser;
Raymond Wooninck's avatar
Raymond Wooninck committed
64 65 66 67 68 69
    parser.addVersionOption();
    parser.addHelpOption();
    aboutData.setupCommandLine(&parser);
    parser.process(a);
    aboutData.processCommandLine(&parser);

70
    a.setWindowIcon(QIcon::fromTheme(QStringLiteral("kshisen")));
Albert Astals Cid's avatar
Icon  
Albert Astals Cid committed
71

Laurent Montel's avatar
Laurent Montel committed
72 73
    KDBusService service;

Frederik Schwarzer's avatar
Frederik Schwarzer committed
74
    auto app = new App();
Frederik Schwarzer's avatar
Frederik Schwarzer committed
75 76
    app->show();
    return a.exec();
77
}
Benjamin Meyer's avatar
Benjamin Meyer committed
78

79 80
// vim: expandtab:tabstop=4:shiftwidth=4
// kate: space-indent on; indent-width 4