Commit f2f14e5a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to make it compile

parent b79efba2
project(ksirk)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.2.0")
if(NOT COMPILING_KDEGAMES)
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
find_package(KDEGames 4.9.0 REQUIRED)
find_package(QCA2 REQUIRED)
find_package(ECM 1.3.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
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})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test)
find_package(KF5 REQUIRED COMPONENTS
CoreAddons
Config
WidgetsAddons
Config
DBusAddons
Declarative
I18n
GuiAddons
ConfigWidgets
ItemViews
IconThemes
Completion
TextWidgets
XmlGui
KIO
Wallet
NotifyConfig
NewStuff)
macro_log_feature(QCA2_FOUND "QCA2" "Qt Cryptographic Architecture" "http://delta.affinix.com/qca" TRUE "2.0.0" "Needed to build Ksirk Jabber support's GroupWise and Jabberprotocols.")
macro_display_feature_log()
endif(NOT COMPILING_KDEGAMES)
find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 REQUIRED)
KDE4_NO_ENABLE_FINAL(ksirk)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
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="kbounce")
find_package(Phonon4Qt5 CONFIG REQUIRED)
find_package(Qca 2.1.0)
set_package_properties(Qca PROPERTIES DESCRIPTION "Support for encryption"
URL "http://delta.affinix.com/qca"
TYPE REQUIRED)
kde_enable_exceptions()
remove_definitions(-DQT_NO_STL)
add_subdirectory(ksirk)
add_subdirectory(ksirkskineditor)
add_subdirectory(doc)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
add_subdirectory(ksirkskineditor)
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ksirk)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ksirk)
......@@ -37,8 +37,9 @@ link_directories( ${CMAKE_CURRENT_BINARY_DIR}/iris/ )
set(ksirk_SRCS
GameLogic/gameautomaton.cpp
kgamewin.cpp
kgamewinslots.cpp
#READD
#kgamewin.cpp
#kgamewinslots.cpp
gestionSprites.cpp
Sprites/backgnd.cpp
Sprites/animsprite.cpp
......@@ -75,7 +76,8 @@ set(ksirk_SRCS
Dialogs/restartOrExitDialogImpl.cpp
Dialogs/joingame.cpp
Dialogs/jabbergameui.cpp
Dialogs/InvasionSlider.cpp
#READD
#Dialogs/InvasionSlider.cpp
Dialogs/newGameSummaryWidget.cpp
Dialogs/tcpconnectwidget.cpp
main.cpp
......@@ -109,31 +111,33 @@ set(ksirk_UI
)
kde4_add_ui_files(ksirk_SRCS ${ksirk_UI} )
ki18n_wrap_ui(ksirk_SRCS ${ksirk_UI} )
kde4_add_kcfg_files( ksirk_SRCS ksirksettings.kcfgc )
kconfig_add_kcfg_files( ksirk_SRCS ksirksettings.kcfgc )
kde4_add_app_icon(ksirk_SRCS "hi*-app-ksirk.png")
kde4_add_executable(ksirk ${ksirk_SRCS})
add_executable(ksirk ${ksirk_SRCS})
target_link_libraries(ksirk
${QT_QTXML_LIBRARY}
${QT_QTSVG_LIBRARY}
${KDE4_KIO_LIBS}
${KDE4_PHONON_LIBRARY}
${KDE4_KNEWSTUFF3_LIBRARY}
${QCA2_LIBRARIES}
Qt5::Xml
Qt5::Svg
KF5::KIOCore
Phonon::phonon4qt5
KF5::NewStuff
qca
iris_ksirk
kdegames
kdegamesprivate
KF5KDEGames
KF5KDEGamesprivate
KF5::KDELibs4Support
KF5::Wallet
)
install( TARGETS ksirk ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
kde4_install_icons( ${ICON_INSTALL_DIR} )
ecm_install_icons( ${ICON_INSTALL_DIR} )
install( FILES ksirksettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( PROGRAMS ksirk.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
......
......@@ -22,7 +22,7 @@
#include<qstring.h>
#include<qpoint.h>
#include<qpair.h>
#include <QList>
namespace Ksirk {
namespace GameLogic {
......
......@@ -64,10 +64,13 @@ ONU::ONU(GameAutomaton* automaton,
QFileInfo qfi(m_configFileName);
kDebug() << "skin written at :" << qfi.lastModified().toTime_t();
kDebug() << "cache created at:" << m_automaton->pixmapCache().timestamp();
#pragma message("port to qt5")
#if 0
if (m_automaton->pixmapCache().timestamp() < qfi.lastModified().toTime_t())
{
m_automaton->pixmapCache().discard();
}
#endif
m_font.family = "URW Chancery L";
m_font.size = (uint)(13*m_zoom);
m_font.weight = QFont::Bold;
......
......@@ -49,7 +49,7 @@ AnimSprite::AnimSprite(const QString &svgid,
double zoom,
BackGnd* aBackGnd,
unsigned int visibility) :
QGraphicsPixmapItem(0, aBackGnd-> scene()),
QGraphicsPixmapItem(0),
m_animated(false), m_zoom(zoom), m_svgid(svgid),
look(right), nbVersions(nbDirs),
backGnd(aBackGnd), destination(0), destinationPoint(), frames(nbFrames), actFrame(0),
......@@ -64,6 +64,7 @@ AnimSprite::AnimSprite(const QString &svgid,
m_timer(this),
m_skin(backGnd->onu()->skin())
{
aBackGnd-> scene()->addItem(this);
// kDebug() << svgid << nbFrames;
setNone();
......
......@@ -33,8 +33,9 @@ namespace Ksirk
using namespace GameLogic;
BackGnd::BackGnd(QGraphicsScene *scene, const GameLogic::ONU* theWorld, bool arena) :
QGraphicsPixmapItem(0, scene), m_theWorld(theWorld), m_bgIsArena(arena)
QGraphicsPixmapItem(0), m_theWorld(theWorld), m_bgIsArena(arena)
{
scene->addItem(this);
kDebug() << "BackGnd constructor" << endl;
QPixmap pix;
......
......@@ -94,8 +94,14 @@ include_directories(
xmpp/xmpp-im
${QCA2_INCLUDE_DIR}
)
kde4_moc_headers(iris_ksirk
qt5_wrap_cpp(libiris_SRCS
xmpp/xmpp-im/xmpp_client.h
xmpp/xmpp-core/xmpp_clientstream.h
xmpp/xmpp-core/xmpp_stream.h
xmpp/xmpp-core/xmpp.h
)
if(0)
qt5_wrap_cpp(libiris_SRCS
irisnet/corelib/jdnsshared.h
irisnet/corelib/netavailability.h
irisnet/corelib/netinterface.h
......@@ -108,7 +114,6 @@ xmpp/base64/base64.h
xmpp/cutestuff/bsocket.h
xmpp/cutestuff/bytestream.h
xmpp/cutestuff/httpconnect.h
xmpp/cutestuff/socks.h
xmpp/cutestuff/httppoll.h
xmpp/sasl/digestmd5proplist.cpp
xmpp/sasl/digestmd5response.cpp
......@@ -125,12 +130,11 @@ xmpp/zlib/common.h
xmpp/zlib/zlibcompressor.h
xmpp/zlib/zlibdecompressor.h
)
endif()
add_library(iris_ksirk SHARED ${libiris_SRCS})
kde4_add_library(iris_ksirk SHARED ${libiris_SRCS})
set(iris_ksirk_libs ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY}
${IDN_LIBRARY} ${QCA2_LIBRARIES} ${ZLIB_LIBRARIES})
set(iris_ksirk_libs Qt5::Core Qt5::Gui Qt5::Network Qt5::Xml ${IDN_LIBRARY} qca ${ZLIB_LIBRARIES} Qt5::Widgets)
if(WIN32)
set(iris_ksirk_libs ${iris_ksirk_libs} ws2_32)
endif(WIN32)
......@@ -149,5 +153,4 @@ set_target_properties(iris_ksirk PROPERTIES
)
install(TARGETS iris_ksirk ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
......@@ -92,7 +92,9 @@ static ProcessQuit *g_pq = 0;
inline bool is_gui_app()
{
#ifdef QT_GUI_LIB
return (QApplication::type() != QApplication::Tty);
#pragma message("Port to Qt5")
//QT5 return (QApplication::type() != QApplication::Tty);
return false;
#else
return false;
#endif
......
......@@ -62,6 +62,7 @@
#include <QHostInfo>
// include files for KDE
#include <K4AboutData>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
......@@ -79,11 +80,11 @@
#include <kglobal.h>
#include <KStatusBar>
#include <KToolBar>
#include <KAction>
#include <QAction>
#include <QSvgRenderer>
#include <KDialog>
#include <KAboutData>
#include <KIcon>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgame/kgamechat.h>
......@@ -403,7 +404,7 @@ void KGameWindow::initActions()
KMessageBox::error(0, i18n("Cannot load button image %1<br>Program cannot continue",QString(CM_NEWNETGAME)), i18n("Error!"));
exit(2);
}
KAction* newSocketAction = new KAction(KIcon(QPixmap(imageFileName)), i18n("New Standard TCP/IP Network Game"), this);
QAction * newSocketAction = new QAction(KIcon(QPixmap(imageFileName)), i18n("New Standard TCP/IP Network Game"), this);
newSocketAction->setIconText(i18n("New TCP/IP"));
newSocketAction->setShortcut(Qt::CTRL+Qt::Key_T);
newSocketAction->setStatusTip(i18n("Create a new standard TCP/IP network game"));
......@@ -420,7 +421,7 @@ void KGameWindow::initActions()
KMessageBox::error(0, i18n("Cannot load button image %1<br>Program cannot continue",QString(CM_NEWNETGAME)), i18n("Error!"));
exit(2);
}
KAction* joinAction = new KAction(KIcon(QPixmap(imageFileName)),
QAction * joinAction = new QAction(KIcon(QPixmap(imageFileName)),
i18n("Join a Standard TCP/IP Network Game"), this);
joinAction->setIconText(i18n("Join TCP/IP"));
joinAction->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_J);
......@@ -429,7 +430,7 @@ void KGameWindow::initActions()
kDebug() << "Adding action game_join_socket";
actionCollection()->addAction("game_join_socket", joinAction);
m_goalAction = new KAction(KIcon(), i18n("Goal"), this);
m_goalAction = new QAction(KIcon(), i18n("Goal"), this);
m_goalAction-> setText(i18n("Display the Current Player's Goal"));
m_goalAction-> setIconText(" ");
m_goalAction->setShortcut(Qt::CTRL+Qt::Key_G);
......@@ -439,7 +440,7 @@ void KGameWindow::initActions()
kDebug() << "Adding action game_goal";
actionCollection()->addAction("game_goal", m_goalAction);
m_contextualHelpAction = new KAction(KIcon(),
m_contextualHelpAction = new QAction(KIcon(),
i18n("Contextual Help"), this);
m_contextualHelpAction->setEnabled(false);
m_contextualHelpAction->setShortcut(Qt::CTRL+Qt::Key_F1);
......@@ -448,14 +449,14 @@ void KGameWindow::initActions()
QString nextPlayerActionImageFileName = KGlobal::dirs()->findResource("appdata", m_automaton->skin() + '/' + CM_NEXTPLAYER);
m_nextPlayerAction = new KAction(KIcon(nextPlayerActionImageFileName),
m_nextPlayerAction = new QAction(KIcon(nextPlayerActionImageFileName),
i18n("Next Player"), this);
connect(m_nextPlayerAction, SIGNAL(triggered(bool)), this, SLOT(slotNextPlayer()));
m_contextualHelpAction->setStatusTip(i18n("Lets the next player play"));
m_nextPlayerAction->setEnabled(false);
actionCollection()->addAction("game_nextplayer", m_nextPlayerAction);
KAction* finishMovesAction = new KAction(KIcon(),
QAction * finishMovesAction = new QAction(KIcon(),
i18n("Finish moves"), this);
finishMovesAction->setShortcut(Qt::Key_Space);
finishMovesAction->setStatusTip(i18n("Finish moving the current sprites"));
......
......@@ -61,7 +61,7 @@ class QAction;
class KGameChat;
class KGamePopupItem;
class KDialog;
class KAction;
class QAction;
class QEvent;
class QDockWidget;
......@@ -1022,7 +1022,7 @@ private: // Private members
* This button is used to display the flag of the currently active player
* in the status bar.
*/
KAction* m_goalAction;
QAction * m_goalAction;
QAction* m_jabberAction;
QLabel* m_barFlag;
......@@ -1093,10 +1093,10 @@ private: // Private members
QString m_fileName;
QAction* m_nextPlayerAction;
KAction* m_saveGameAction;
KAction* m_zoomInAction;
KAction* m_zoomOutAction;
KAction* m_contextualHelpAction;
QAction * m_saveGameAction;
QAction * m_zoomInAction;
QAction * m_zoomOutAction;
QAction * m_contextualHelpAction;
Sprites::ArrowSprite* m_uparrow;
Sprites::ArrowSprite* m_downarrow;
......
......@@ -21,7 +21,7 @@
#define _KSIRKCONFIGDIALOG_H_
#include <kconfigdialog.h>
#include <KConfigSkeleton>
namespace Ui
{
class KsirkPreferencesWidget;
......
......@@ -22,7 +22,7 @@ This is the standard main function of a KDE application simplified for KsirK
#include "GameLogic/gameautomaton.h"
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <K4AboutData>
#include <klocale.h>
#include <kdebug.h>
#include <KApplication>
......@@ -36,8 +36,8 @@ static const char *description =
int main(int argc, char *argv[])
{
kDebug() << "Hello World!";
KAboutData aboutData( "ksirk", 0, ki18n("KsirK"),
KDE_VERSION_STRING, ki18n(description), KAboutData::License_GPL,
K4AboutData aboutData( "ksirk", 0, ki18n("KsirK"),
KDE_VERSION_STRING, ki18n(description), K4AboutData::License_GPL,
ki18n("(c) 2002-2013, Gaël de Chalendar\n"),
ki18n("For help and user manual, please see\nthe KsirK web site."),
"http://games.kde.org/game.php?game=ksirk");
......
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