main.cpp 3.48 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

21
#include "app.h"
22 23
#include "commit.h"
#include "version.h"
24

Raymond Wooninck's avatar
Raymond Wooninck committed
25 26 27 28 29 30 31
#include <KAboutData>
#include <Kdelibs4ConfigMigrator>

#include <QCommandLineParser>
#include <QApplication>
#include <KLocalizedString>
#include <QCommandLineParser>
Waldo Bastian's avatar
Waldo Bastian committed
32

Jaison Lee's avatar
Jaison Lee committed
33
static const char description[] = I18N_NOOP("A KDE game similar to Mahjongg");
34

35 36
int main(int argc, char **argv)
{
Raymond Wooninck's avatar
Raymond Wooninck committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    KAboutData aboutData("kshisen", i18n("Shisen-Sho"),
                         KSHISEN_VERSION " #" KSHISEN_COMMIT, i18n(description), KAboutLicense::GPL,
                         i18n("(c) 1997, Mario Weilguni")); 
    aboutData.setHomepage("http://games.kde.org/kshisen");
    aboutData.addAuthor(i18n("Frederik Schwarzer"), i18n("Current Maintainer"), "schwarzer@kde.org");
    aboutData.addAuthor(i18n("Dave Corrie"), i18n("Former Maintainer"), "kde@davecorrie.com");
    aboutData.addAuthor(i18n("Mario Weilguni"), i18n("Original Author"), "mweilguni@sime.com");
    aboutData.addCredit(i18n("Mauricio Piacentini"), i18n("KMahjonggLib integration for KDE4"), "mauricio@tabuleiro.com");
    aboutData.addCredit(i18n("Jason Lane"), i18n("Added 'tiles removed' counter<br/>Tile smooth-scaling and window resizing"), "jglane@btopenworld.com");
    aboutData.addCredit(i18n("Thanks also to everyone who should be listed here but is not!"));
    QApplication a(argc, argv);
    QCommandLineParser parser;
    KAboutData::setApplicationData(aboutData);
    parser.addVersionOption();
    parser.addHelpOption();
    aboutData.setupCommandLine(&parser);
    parser.process(a);
    aboutData.processCommandLine(&parser);

    // Migrate pre-existing (4.x) configuration
    QStringList configFiles;
    configFiles.append(QLatin1String("kshisenrc"));
    configFiles.append(QLatin1String("kshisen.notifyrc"));

    Kdelibs4ConfigMigrator migrate(QLatin1String("kshisen"));
    migrate.setConfigFiles(configFiles);
    migrate.setUiFiles(QStringList() << QLatin1String("kshisenui.rc"));
    migrate.migrate();
65

Frederik Schwarzer's avatar
Frederik Schwarzer committed
66 67 68
    App *app = new App();
    app->show();
    return a.exec();
69
}
Benjamin Meyer's avatar
Benjamin Meyer committed
70

71 72
// vim: expandtab:tabstop=4:shiftwidth=4
// kate: space-indent on; indent-width 4