Commit 0cdf47a8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile

parent 7d9eb17e
PROJECT(ksquares)
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames REQUIRED)
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 Test)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
WidgetsAddons
Config
I18n
GuiAddons
ConfigWidgets
ItemViews
IconThemes
XmlGui
KIO
NotifyConfig
KDELibs4Support)
find_package(KF5KDEGames 4.9.0 REQUIRED)
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
include(ECMAddTests)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="ksquares")
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(src)
add_subdirectory(doc)
\ No newline at end of file
add_subdirectory(doc)
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ksquares)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ksquares)
......@@ -12,16 +12,16 @@ set(ksquares_SRCS
highlightanimation.cpp
)
include_directories(${CMAKE_SOURCE_DIR}/libkdegames/highscore)
include_directories(${CMAKE_SOURCE_DIR}/libKF5KDEGames/highscore)
kde4_add_ui_files(ksquares_SRCS newgamewidget.ui scoreswidget.ui prefs_ai.ui prefs_display.ui)
ki18n_wrap_ui(ksquares_SRCS newgamewidget.ui scoreswidget.ui prefs_ai.ui prefs_display.ui)
kde4_add_kcfg_files(ksquares_SRCS GENERATE_MOC settings.kcfgc) #GENERATE_MOC is not needed but it doesn't work without it for some reason :S
kconfig_add_kcfg_files(ksquares_SRCS GENERATE_MOC settings.kcfgc) #GENERATE_MOC is not needed but it doesn't work without it for some reason :S
kde4_add_app_icon(ksquares_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-app-ksquares.png")
kde4_add_executable(ksquares ${ksquares_SRCS})
add_executable(ksquares ${ksquares_SRCS})
target_link_libraries(ksquares ${KDE4_KDEUI_LIBS} kdegames)
target_link_libraries(ksquares KF5KDEGames KF5::KDELibs4Support)
install(TARGETS ksquares ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -31,4 +31,4 @@ install(TARGETS ksquares ${INSTALL_TARGETS_DEFAULT_ARGS})
install( PROGRAMS ksquares.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES ksquares.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES ksquaresui.rc DESTINATION ${DATA_INSTALL_DIR}/ksquares )
kde4_install_icons(${ICON_INSTALL_DIR})
ecm_install_icons(${ICON_INSTALL_DIR})
......@@ -39,7 +39,7 @@ KSquaresDemoWindow::KSquaresDemoWindow() : KXmlGuiWindow(), m_view(new GameBoard
KStandardGameAction::quit(kapp, SLOT(quit()), actionCollection());
setupGUI();
statusBar()->insertPermanentItem(i18n("Current Player"), 0);
//QT5 statusBar()->insertPermanentItem(i18n("Current Player"), 0);
statusBar()->show();
}
......@@ -91,7 +91,7 @@ void KSquaresDemoWindow::gameNew()
void KSquaresDemoWindow::playerTakeTurn(KSquaresPlayer* currentPlayer)
{
statusBar()->changeItem(currentPlayer->name(), 0);
//QT5 statusBar()->changeItem(currentPlayer->name(), 0);
QTimer::singleShot(200, this, SLOT(aiChooseLine()));
}
......
......@@ -23,7 +23,7 @@
#include <KHighscore>
#include <KStandardGameAction>
#include <KStatusBar>
#include <KAction>
#include <QAction>
//generated
#include "settings.h"
......@@ -57,7 +57,7 @@ void KSquaresWindow::initObject()
m_view->setRenderHints(QPainter::Antialiasing);
m_view->setFrameStyle(QFrame::NoFrame);
setupActions();
statusBar()->insertPermanentItem(i18n("Current Player"), statusplayer);
//QT5 statusBar()->insertPermanentItem(i18n("Current Player"), statusplayer);
statusBar()->show();
setAutoSaveSettings();
......@@ -265,12 +265,14 @@ void KSquaresWindow::gameOver(const QVector<KSquaresPlayer> &_playerList)
void KSquaresWindow::playerTakeTurn(KSquaresPlayer* currentPlayer)
{
//kDebug() << "void KSquares::playerTakeTurn(KSquaresPlayer* currentPlayer)";
#if 0 //QT5
statusBar()->changeItem(
QString::fromLatin1("<font color=\"%1\">%2</font>")
.arg(currentPlayer->colour().name())
.arg(currentPlayer->name()),
statusplayer
);
#endif
if(currentPlayer->isHuman())
{
//Let the human player interact with the board through the GameBoardView
......@@ -299,7 +301,7 @@ void KSquaresWindow::aiChooseLine()
void KSquaresWindow::setupActions()
{
KStandardGameAction::gameNew(this, SLOT(gameNew()), actionCollection());
KAction *resetGame = KStandardGameAction::restart(this, SLOT(gameReset()), actionCollection());
QAction *resetGame = KStandardGameAction::restart(this, SLOT(gameReset()), actionCollection());
resetGame->setStatusTip(i18n("Start a new game with the current settings"));
KStandardGameAction::highscores(this, SLOT(showHighscores()), actionCollection());
......
......@@ -8,11 +8,11 @@
***************************************************************************/
#include <KApplication>
#include <KAboutData>
#include <K4AboutData>
#include <KCmdLineArgs>
#include <KLocale>
#include <KUser>
#include <KGlobal>
#include <KDebug>
#include "ksquareswindow.h"
......@@ -26,8 +26,8 @@ static const char version[] = "0.5";
int main(int argc, char **argv)
{
KAboutData about("ksquares", 0, ki18n("KSquares"), version, ki18n(description),
KAboutData::License_GPL, ki18n("(C) 2006-2007 Matt Williams"), KLocalizedString(),
K4AboutData about("ksquares", 0, ki18n("KSquares"), version, ki18n(description),
K4AboutData::License_GPL, ki18n("(C) 2006-2007 Matt Williams"), KLocalizedString(),
"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"));
......@@ -41,7 +41,6 @@ int main(int argc, char **argv)
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
KApplication app;
KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
// default names for players
KConfigGroup cg(KGlobal::config(), "General");
......
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