summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2014-12-08 13:56:53 +0100
committerMontel Laurent <[email protected]>2014-12-08 13:56:53 +0100
commit48848e28569663b808ff94250ccf77eda4c79f95 (patch)
tree338c21c675315711ae57e68b5f5f15a07c9e0899
parent3b99dd26f4706985c4ea577ff3ffbd34a9e63d69 (diff)
Fix install file. kdelibs4support--
-rw-r--r--CMakeLists.txt4
-rw-r--r--gamescene.cpp4
-rw-r--r--main.cpp57
-rw-r--r--mainwindow.cpp10
-rw-r--r--undo.h2
5 files changed, 41 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc759fc..3d2b3b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,7 +54,9 @@ add_executable(klickety ${klickety_SRCS})
target_link_libraries(klickety KF5::NotifyConfig KF5KDEGames KF5::KIOCore KF5::KDELibs4Support)
install(TARGETS klickety ${INSTALL_TARGETS_DEFAULT_ARGS})
-install(FILES klickety.kcfg klickety.notifyrc klicketyui.rc DESTINATION ${DATA_INSTALL_DIR}/klickety)
+install(FILES klickety.kcfg klickety.notifyrc DESTINATION ${DATA_INSTALL_DIR}/klickety)
+install(FILES klicketyui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/klickety)
+
install(PROGRAMS org.kde.klickety.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(PROGRAMS ksame.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
diff --git a/gamescene.cpp b/gamescene.cpp
index 87f1ee9..0984229 100644
--- a/gamescene.cpp
+++ b/gamescene.cpp
@@ -29,9 +29,7 @@
#include <KgThemeProvider>
#include <KNotification>
#include <KRandomSequence>
-#include <KLocale>
-
-#include <KDebug>
+#include <KLocalizedString>
#include <QEasingCurve>
#include <QGraphicsColorizeEffect>
diff --git a/main.cpp b/main.cpp
index 25bcb8a..f5530b8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -19,30 +19,37 @@
#include "mainwindow.h"
#include "settings.h"
-#include <K4AboutData>
-#include <KApplication>
-#include <KCmdLineArgs>
-#include <KLocale>
+#include <KAboutData>
+
+
+#include <KLocalizedString>
#include <ctime>
+#include <QApplication>
+#include <QCommandLineParser>
+#include <QCommandLineOption>
int main( int argc, char* argv[] )
{
qsrand( time(0) );
- K4AboutData aboutData( "klickety", 0, ki18n( "Klickety" ), "2.0",
- ki18n( "Klickety is an adaptation of the \"clickomania\" game" ),
- K4AboutData::License_GPL,
- ki18n( "(c) 2002-2005, Nicolas Hadacek\n(c) 2010, Ni Hui" ),
- KLocalizedString(), "http://games.kde.org/klickety" );
+ KAboutData aboutData( "klickety", i18n( "Klickety" ), "2.0",
+ i18n( "Klickety is an adaptation of the \"clickomania\" game" ),
+ KAboutLicense::GPL,
+ i18n( "(c) 2002-2005, Nicolas Hadacek\n(c) 2010, Ni Hui" ),
+ "http://games.kde.org/klickety" );
- KCmdLineArgs::init( argc, argv, &aboutData );
+ QApplication app(argc, argv);
+ QCommandLineParser parser;
+ KAboutData::setApplicationData(aboutData);
+ parser.addVersionOption();
+ parser.addHelpOption();
+ parser.addOption(QCommandLineOption(QStringList() << QLatin1String("KSameMode"), i18n( "Start with KSame compatibility mode" )));
- KCmdLineOptions options;
- options.add( "KSameMode", ki18n( "Start with KSame compatibility mode" ) );
- KCmdLineArgs::addCmdLineOptions( options );
+ aboutData.setupCommandLine(&parser);
+ parser.process(app);
+ aboutData.processCommandLine(&parser);
- KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
- bool KSameMode = args->isSet( "KSameMode" );
+ bool KSameMode = parser.isSet( "KSameMode" );
// set kconfig instance
// we use different file for storing ksame mode configuration
@@ -51,24 +58,22 @@ int main( int argc, char* argv[] )
else {
Settings::instance( QLatin1String( "klicketyrc" ) );
}
- args->clear();
+
if ( KSameMode ) {
- aboutData.setProgramName( ki18n( "SameGame" ) );
aboutData.setProgramIconName( "ksame" );
- aboutData.setShortDescription( ki18n( "A little game about balls and how to get rid of them" ) );
- aboutData.addAuthor( ki18n( "Marcus Kreutzberger"), ki18n( "Original author" ), "[email protected]" );
- aboutData.addAuthor( ki18n( "Henrique Pinto"), ki18n( "Past maintainer" ), "[email protected]" );
- aboutData.addAuthor( ki18n( "Ni Hui" ), ki18n( "Integration with Klickety. Current maintainer" ), "[email protected]" );
- aboutData.addCredit( ki18n( "Johann Ollivier Lapeyre"), ki18n("Artwork"), "[email protected]" );
+ aboutData.setShortDescription( i18n( "A little game about balls and how to get rid of them" ) );
+ aboutData.addAuthor( i18n( "Marcus Kreutzberger"), i18n( "Original author" ), "[email protected]" );
+ aboutData.addAuthor( i18n( "Henrique Pinto"), i18n( "Past maintainer" ), "[email protected]" );
+ aboutData.addAuthor( i18n( "Ni Hui" ), i18n( "Integration with Klickety. Current maintainer" ), "[email protected]" );
+ aboutData.addCredit( i18n( "Johann Ollivier Lapeyre"), i18n("Artwork"), "[email protected]" );
}
else {
- aboutData.addAuthor( ki18n( "Nicolas Hadacek" ), ki18n( "Original author" ), "[email protected]" );
- aboutData.addAuthor( ki18n( "Ni Hui" ), ki18n( "Rewrite for KDE4. Current maintainer" ), "[email protected]" );
- aboutData.addCredit( ki18n( "Dan Hill" ), ki18n( "Icons" ) );
+ aboutData.addAuthor( i18n( "Nicolas Hadacek" ), i18n( "Original author" ), "[email protected]" );
+ aboutData.addAuthor( i18n( "Ni Hui" ), i18n( "Rewrite for KDE4. Current maintainer" ), "[email protected]" );
+ aboutData.addCredit( i18n( "Dan Hill" ), i18n( "Icons" ) );
}
- KApplication app;
//resource directory for KNewStuff2
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 80a1f88..c440cff 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -34,16 +34,16 @@
#include <KgDifficulty>
#include <KgThemeSelector>
#include <KInputDialog>
-#include <KLocale>
+#include <KLocalizedString>
#include <KMessageBox>
#include <KNotifyConfigWidget>
#include <KScoreDialog>
#include <KStandardAction>
#include <KStandardGameAction>
-#include <KStatusBar>
+#include <QStatusBar>
#include <KToggleAction>
#include <KUrl>
-#include <KIcon>
+#include <QIcon>
#include <QPointer>
MainWindow::MainWindow( bool KSameMode, QWidget* parent )
@@ -359,13 +359,13 @@ void MainWindow::setupActions()
connect( m_scene, SIGNAL(canRedoChanged(bool)), redoAction, SLOT(setEnabled(bool)) );
QAction * undoAllAction = actionCollection()->addAction( QLatin1String( "move_undo_all" ) );
- undoAllAction->setIcon( KIcon( QLatin1String( "media-skip-backward" ) ) );
+ undoAllAction->setIcon( QIcon::fromTheme( QLatin1String( "media-skip-backward" ) ) );
undoAllAction->setText( i18n( "Undo All" ) );
undoAllAction->setEnabled( false );
connect( m_scene, SIGNAL(canUndoChanged(bool)), undoAllAction, SLOT(setEnabled(bool)) );
connect( undoAllAction, SIGNAL(triggered(bool)), m_scene, SLOT(undoAllMove()) );
QAction * redoAllAction = actionCollection()->addAction( QLatin1String( "move_redo_all" ) );
- redoAllAction->setIcon( KIcon( QLatin1String( "media-skip-forward" ) ) );
+ redoAllAction->setIcon( QIcon::fromTheme( QLatin1String( "media-skip-forward" ) ) );
redoAllAction->setText( i18n( "Redo All" ) );
redoAllAction->setEnabled( false );
connect( m_scene, SIGNAL(canRedoChanged(bool)), redoAllAction, SLOT(setEnabled(bool)) );
diff --git a/undo.h b/undo.h
index 2783e3c..59963fd 100644
--- a/undo.h
+++ b/undo.h
@@ -21,7 +21,7 @@
#include <QPointF>
#include <QUndoCommand>
-#include <klocale.h>
+#include <KLocalizedString>
#include "piece.h"
const int ID_HIDEPIECE = 100;