Commit 5529d7f6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Reverse dns desktop. Migrate settings.

parent e2c2dca6
......@@ -28,7 +28,7 @@ install(TARGETS ksquares ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( PROGRAMS ksquares.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( PROGRAMS org.kde.ksquares.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES ksquares.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES ksquaresui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/ksquares )
ecm_install_icons(ICONS hi128-apps-ksquares.png hi16-apps-ksquares.png hi22-apps-ksquares.png hi32-apps-ksquares.png hi48-apps-ksquares.png hi64-apps-ksquares.png DESTINATION ${ICON_INSTALL_DIR})
......@@ -7,13 +7,18 @@
* (at your option) any later version. *
***************************************************************************/
#include <KApplication>
#include <K4AboutData>
#include <KCmdLineArgs>
#include <KAboutData>
#include <KLocale>
#include <KUser>
#include <KGlobal>
#include <QDebug>
#include <QApplication>
#include <KLocalizedString>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <kdelibs4configmigrator.h>
#include "ksquareswindow.h"
#include "ksquaresdemowindow.h"
......@@ -26,21 +31,30 @@ static const char version[] = "0.5";
int main(int argc, char **argv)
{
K4AboutData about("ksquares", 0, ki18n("KSquares"), version, ki18n(description),
K4AboutData::License_GPL, ki18n("(C) 2006-2007 Matt Williams"), KLocalizedString(),
Kdelibs4ConfigMigrator migrate(QLatin1String("ksquares"));
migrate.setConfigFiles(QStringList() << QLatin1String("ksquaresrc"));
migrate.setUiFiles(QStringList() << QLatin1String("ksquaresui.rc"));
migrate.migrate();
KAboutData about("ksquares", i18n("KSquares"), version, i18n(description),
KAboutLicense::GPL, i18n("(C) 2006-2007 Matt Williams"),
"http://games.kde.org/ksquares");
about.addAuthor( ki18n("Matt Williams"), ki18n("Original creator and maintainer"), "matt@milliams.com", "http://milliams.com" );
about.addCredit(ki18n("Fela Winkelmolen"), ki18n("Many patches and bugfixes"));
about.addCredit(ki18n("Tom Vincent Peters"), ki18n("Hard AI"));
about.addAuthor( i18n("Matt Williams"), i18n("Original creator and maintainer"), "matt@milliams.com", "http://milliams.com" );
about.addCredit(i18n("Fela Winkelmolen"), i18n("Many patches and bugfixes"));
about.addCredit(i18n("Tom Vincent Peters"), i18n("Hard AI"));
KCmdLineArgs::init(argc, argv, &about);
QApplication app(argc, argv);
QCommandLineParser parser;
KAboutData::setApplicationData(about);
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("demo"), i18n("Run game in demo (autoplay) mode")));
KCmdLineOptions options;
options.add("demo", ki18n("Run game in demo (autoplay) mode"));
KCmdLineArgs::addCmdLineOptions( options );
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
//PORTING SCRIPT: adapt aboutdata variable if necessary
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
KApplication app;
// default names for players
KConfigGroup cg(KSharedConfig::openConfig(), "General");
......@@ -54,7 +68,7 @@ int main(int argc, char **argv)
cg.writeEntry("initializeNames", false);
}
if (args->isSet("demo"))
if (parser.isSet("demo"))
{
KSquaresDemoWindow *demoWindow = new KSquaresDemoWindow;
demoWindow->show();
......@@ -65,7 +79,7 @@ int main(int argc, char **argv)
KSquaresWindow *mainWindow = new KSquaresWindow;
mainWindow->show();
}
args->clear();
return app.exec();
}
......@@ -110,3 +110,4 @@ GenericName[zh_CN]=通过点连接创建方形
GenericName[zh_TW]=將點連起來組成方塊
Terminal=false
Categories=Game;BoardGame;Qt;KDE;
X-DBUS-ServiceName=org.kde.ksquares
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment