Commit 3b6994a4 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile

parent 35ef6cc3
project(kspaceduel)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")
find_package(ECM 1.3.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
ItemModels
WidgetsAddons
WindowSystem
Config
DBusAddons
I18n
ConfigWidgets
TextWidgets
XmlGui
KIO
NotifyConfig
NewStuff
KDELibs4Support)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)
include_directories(BEFORE ${PHONON_INCLUDES})
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="kspaceduel")
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames REQUIRED)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories(${KDEGAMES_INCLUDE_DIRS} ${KDE4_INCLUDES} ${QDBUS_INCLUDE_DIRS})
endif(NOT COMPILING_KDEGAMES)
add_subdirectory( sprites )
add_subdirectory( pics )
......@@ -28,14 +56,14 @@ set(kspaceduel_SRCS
spritebase.cpp
topwidget.cpp)
kde4_add_ui_files(kspaceduel_SRCS general.ui )
ki18n_wrap_ui(kspaceduel_SRCS general.ui )
kde4_add_kcfg_files(kspaceduel_SRCS options.kcfgc )
kconfig_add_kcfg_files(kspaceduel_SRCS options.kcfgc )
kde4_add_app_icon(kspaceduel_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-app-kspaceduel.png")
kde4_add_executable(kspaceduel ${kspaceduel_SRCS})
add_executable(kspaceduel ${kspaceduel_SRCS})
target_link_libraries(kspaceduel ${KDE4_KDEUI_LIBS} kdegames)
target_link_libraries(kspaceduel KF5KDEGames KF5::KDELibs4Support Qt5::Svg)
install(TARGETS kspaceduel ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(FILES default_theme.svgz DESTINATION ${DATA_INSTALL_DIR}/kspaceduel/sprites )
......@@ -47,7 +75,7 @@ install( PROGRAMS kspaceduel.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES kspaceduel.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES kspaceduelui.rc DESTINATION ${DATA_INSTALL_DIR}/kspaceduel )
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons( ${ICON_INSTALL_DIR} )
......
########### install files ###############
#
#
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kspaceduel)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kspaceduel)
......@@ -18,7 +18,7 @@
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <K4AboutData>
#include <klocale.h>
#include "version.h"
......@@ -28,15 +28,14 @@ static const char description[] = I18N_NOOP("KDE Space Game");
int main(int argc,char **argv)
{
KAboutData aboutData( "kspaceduel", 0, ki18n("KSpaceDuel"),
KSPACEDUEL_VERSION, ki18n(description), KAboutData::License_GPL,
K4AboutData aboutData( "kspaceduel", 0, ki18n("KSpaceDuel"),
KSPACEDUEL_VERSION, ki18n(description), K4AboutData::License_GPL,
ki18n("(c) 1998-2001, Andreas Zehender"), KLocalizedString(), "http://games.kde.org/kspaceduel" );
aboutData.addAuthor(ki18n("Andreas Zehender"),ki18n("Original Program"), "az@azweb.de");
aboutData.addAuthor(ki18n("Branan Riley"),ki18n("SVG Renderer"), "branan@gmail.com");
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication myapplication;
KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
MyTopLevelWidget *top = new MyTopLevelWidget;
top->show();
......
......@@ -28,7 +28,7 @@
#include <QResizeEvent>
#include <QTimerEvent>
#include <kaction.h>
#include <QAction>
#include <kactioncollection.h>
#include <kglobalsettings.h>
#include <klocale.h>
......@@ -38,6 +38,8 @@
#include <QSvgRenderer>
#include <KGlobal>
#include <KShortcut>
#include "ai.h"
#include "options.h"
......@@ -560,7 +562,8 @@ void MyMainView::timerEvent(QTimerEvent *event)
delete textSprite;
textSprite=0;
}
textSprite=new QGraphicsSimpleTextItem(0,&field);
textSprite=new QGraphicsSimpleTextItem(0);
field.addItem(textSprite);
// FIXME
// textSprite->setTextFlags(Qt::AlignCenter);
textSprite->setBrush(QBrush(QColor(255,160,0)));
......
kde4_install_icons( ${DATA_INSTALL_DIR}/kspaceduel/icons )
ecm_install_icons( ${DATA_INSTALL_DIR}/kspaceduel/icons )
......@@ -87,13 +87,13 @@ void MyTopLevelWidget::wins(int pn,int w)
void MyTopLevelWidget::setupActions()
{
KAction* ac;
QAction * ac;
// Game
KStandardGameAction::gameNew(playfield, SLOT(newGame()), actionCollection());
KStandardGameAction::quit(this, SLOT(close()), actionCollection());
KAction* newRoundAct = actionCollection()->addAction( QLatin1String( "new_round" ) );
QAction * newRoundAct = actionCollection()->addAction( QLatin1String( "new_round" ) );
newRoundAct->setIcon( KIcon( QLatin1String( "preferences-desktop-notification-bell" )) );
newRoundAct->setText( i18n( "&New Round" ) );
newRoundAct->setShortcut( Qt::CTRL + Qt::Key_R );
......@@ -102,7 +102,7 @@ void MyTopLevelWidget::setupActions()
MyMainView::pauseAction =
KStandardGameAction::pause(playfield, SLOT(togglePause()), actionCollection());
MyMainView::pauseAction->setChecked( false );
KAction *gameStart = actionCollection()->addAction( QLatin1String( "game_start" ) );
QAction *gameStart = actionCollection()->addAction( QLatin1String( "game_start" ) );
gameStart->setText( i18nc( "start game","Start" ) );
connect(gameStart, SIGNAL(triggered(bool)), playfield, SLOT(start()));
gameStart->setShortcut(GAME_START_SHORTCUT);
......@@ -163,9 +163,9 @@ void MyTopLevelWidget::setupActions()
void MyTopLevelWidget::initStatusBar( )
{
statusBar( )->insertItem(i18n(" paused "),IDS_PAUSE);
statusBar( )->insertItem(QLatin1String( " " ),IDS_MAIN ,1);
statusBar( )->insertItem(QLatin1String( "" ),42);
//QT5 statusBar( )->insertItem(i18n(" paused "),IDS_PAUSE);
//QT5 statusBar( )->insertItem(QLatin1String( " " ),IDS_MAIN ,1);
//QT5 statusBar( )->insertItem(QLatin1String( "" ),42);
}
void MyTopLevelWidget::start()
......@@ -175,7 +175,7 @@ void MyTopLevelWidget::start()
void MyTopLevelWidget::setStatusText(const QString & str,int id)
{
statusBar( )->changeItem(str,id);
//QT5 statusBar( )->changeItem(str,id);
}
void MyTopLevelWidget::keySetup()
......
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