Konquest.cc 3.12 KB
Newer Older
1
/*
2
3
4
5
6
    Copyright 2003 Russell Steffen <rsteffen@bayarea.net>
    Copyright 2003 Stephan Zehetner <s.zehetner@nevox.org>
    Copyright 2006 Dmitry Suzdalev <dimsuz@gmail.com>
    Copyright 2006 Inge Wallin <inge@lysator.liu.se>
    Copyright 2006 Pierre Ducroquet <pinaraf@gmail.com>
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

    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, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
22

Laurent Montel's avatar
Laurent Montel committed
23
24

#include <KAboutData>
Frederik Schwarzer's avatar
Frederik Schwarzer committed
25
#include <KCrash>
Andrius Štikonas's avatar
Andrius Štikonas committed
26
27
#include <Kdelibs4ConfigMigrator>
#include <KDBusService>
Laurent Montel's avatar
Laurent Montel committed
28
#include <KLocalizedString>
Andrius Štikonas's avatar
Andrius Štikonas committed
29
30

#include <QApplication>
Laurent Montel's avatar
Laurent Montel committed
31
#include <QCommandLineParser>
32
33
#include "mainwin.h"

Andy Goossens's avatar
Andy Goossens committed
34
static const char description[] = I18N_NOOP("Galactic Strategy KDE Game");
Andrius Štikonas's avatar
Andrius Štikonas committed
35
#define KONQUEST_VERSION "2.4"
Inge Wallin's avatar
Inge Wallin committed
36

Nicolas Hadacek's avatar
Nicolas Hadacek committed
37
int
38
39
main(int argc, char **argv)
{
Laurent Montel's avatar
Laurent Montel committed
40
41
    QApplication app(argc, argv);

Laurent Montel's avatar
Laurent Montel committed
42
43
44
45
    Kdelibs4ConfigMigrator migrate(QStringLiteral("konquest"));
    migrate.setConfigFiles(QStringList() << QStringLiteral("konquestrc"));
    migrate.setUiFiles(QStringList() << QStringLiteral("konquestui.rc"));
    migrate.migrate();
Laurent Montel's avatar
Laurent Montel committed
46
    KLocalizedString::setApplicationDomain("konquest");
Laurent Montel's avatar
Laurent Montel committed
47
    KAboutData aboutData( QStringLiteral("konquest"), i18n("Konquest"),
Laurent Montel's avatar
Laurent Montel committed
48
        KONQUEST_VERSION, i18n(description), KAboutLicense::GPL,
49
        i18n("Copyright (c) 1999-2013, Developers"), QStringLiteral("https://kde.org/applications/games/org.kde.konquest") );
50

Laurent Montel's avatar
Laurent Montel committed
51
52
53
54
55
56
    aboutData.addAuthor(i18n("Russ Steffen"), QString(), QStringLiteral("rsteffen@bayarea.net"));
    aboutData.addCredit(i18n("Stephan Zehetner"), i18n("Computer/AI Player"), QStringLiteral("s.zehetner@nevox.org"));
    aboutData.addCredit(i18n("Dmitry Suzdalev"), i18n("Port to KDE4"), QStringLiteral("dimsuz@gmail.com"));
    aboutData.addCredit(i18n("Inge Wallin"), i18n("Cleaning and bugfixing"), QStringLiteral("inge@lysator.liu.se"));
    aboutData.addCredit(i18n("Pierre Ducroquet"), i18n("Cleaning and bugfixing, maintenance"), QStringLiteral("pinaraf@gmail.com"));
    aboutData.addCredit(i18n("Sean D'Epagnier"), i18n("Gameplay Enhancements"), QStringLiteral("geckosenator@gmail.com"));
Alexander Schuch's avatar
Alexander Schuch committed
57

58
59
    aboutData.setOrganizationDomain(QByteArray("kde.org"));

Laurent Montel's avatar
Laurent Montel committed
60
61
    QCommandLineParser parser;
    KAboutData::setApplicationData(aboutData);
Frederik Schwarzer's avatar
Frederik Schwarzer committed
62
    KCrash::initialize();
Laurent Montel's avatar
Laurent Montel committed
63
64
65
    aboutData.setupCommandLine(&parser);
    parser.process(app);
    aboutData.processCommandLine(&parser);
Laurent Montel's avatar
Laurent Montel committed
66
    KDBusService service;
Nicolas Hadacek's avatar
Nicolas Hadacek committed
67

Laurent Montel's avatar
Laurent Montel committed
68
    if (app.isSessionRestored())
69
        kRestoreMainWindows<MainWindow>();
Nicolas Hadacek's avatar
Nicolas Hadacek committed
70
71
72
73
    else {
        MainWindow *w = new MainWindow;
        w->show();
    }
Frederik Schwarzer's avatar
Frederik Schwarzer committed
74
    app.setWindowIcon(QIcon::fromTheme(QStringLiteral("konquest")));
Laurent Montel's avatar
Laurent Montel committed
75
    return app.exec();
76
}