Commit 059f42e7 authored by Nemanja Hiršl's avatar Nemanja Hiršl

All the work for removing kdelibs4support and upgrade to KF5 has been done on frameworks.

Merge origin/frameworks to master now
parents 2afd9563 4496e1af
.kdev4/
build/
*.kdev4
project(ksirk)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.2.0")
set (KF5_MIN_VERSION "5.15.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 ${KF5_MIN_VERSION} 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 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Completion
Config
ConfigWidgets
CoreAddons
Crash
DBusAddons
Declarative
DocTools
GuiAddons
I18n
IconThemes
ItemViews
KIO
NewStuff
NotifyConfig
TextWidgets
Wallet
WidgetsAddons
XmlGui
)
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(ECMAddAppIcon)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDECMakeSettings)
include(ECMQtDeclareLoggingCategory)
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
find_package(Phonon4Qt5 CONFIG REQUIRED)
find_package(Qca-qt5 2.1.0)
set_package_properties(Qca-qt5 PROPERTIES DESCRIPTION "Support for encryption"
URL "http://download.kde.org/stable/qca-qt5"
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 ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR ksirk)
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY ksirk '<application>KsirK</application>'>
<!ENTITY kappname "&ksirk;"><!-- replace ksirk here -->
<!ENTITY package "kdegames">
......
kde4_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR ksirkskineditor)
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR ksirkskineditor)
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN" "dtd/kdedbx45.dtd" [
<!ENTITY ksirk '<application>KsirK</application>'>
<!ENTITY ksirkskineditor '<application>KsirK Skin Editor</application>'>
<!ENTITY kappname "&ksirkskineditor;">
......
......@@ -2,12 +2,11 @@ include(CheckIncludeFiles)
check_include_files(sys/stropts.h SYS_STROPTS_H_FOUND)
configure_file(config-ksirk.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-ksirk.h)
add_subdirectory( skins )
add_subdirectory( iris )
add_subdirectory(skins)
add_subdirectory(iris)
add_subdirectory(icons)
# FIND_PACKAGE(QCA2 REQUIRED)
# FIND_PACKAGE(ZLIB REQUIRED)
# macro_log_feature(QCA2_FOUND "QCA2" "Qt Cryptographic Architecture" "http://delta.affinix.com/qca" FALSE "2.0.0" "Needed to build Ksirk Jabber support's GroupWise and Jabberprotocols.")
include_directories(
${CMAKE_BINARY_DIR}/ksirk
......@@ -28,10 +27,9 @@ include_directories(
# ${CMAKE_CURRENT_SOURCE_DIR}/libiris/cutestuff/network/
# ${CMAKE_CURRENT_SOURCE_DIR}/libiris/cutestuff/
# ${CMAKE_CURRENT_SOURCE_DIR}/libiris/iris/
${QCA2_INCLUDE_DIR}
)
link_directories( ${CMAKE_CURRENT_BINARY_DIR}/iris/ )
link_directories(${CMAKE_CURRENT_BINARY_DIR}/iris/)
########### next target ###############
......@@ -95,6 +93,16 @@ set(ksirk_SRCS
Jabber/privacymanager.cpp
)
ecm_qt_declare_logging_category(ksirk_SRCS
HEADER ksirk_debug.h
IDENTIFIER KSIRK_LOG
CATEGORY_NAME org.kde.ksirk)
ecm_qt_declare_logging_category(ksirk_SRCS
HEADER jabber_protocol_debug.h
IDENTIFIER JABBER_PROTOCOL_LOG
CATEGORY_NAME org.kde.ksirk.jabber)
set(ksirk_UI
Dialogs/qplayersetupdialog.ui
Dialogs/newGameDialog.ui
......@@ -109,35 +117,37 @@ 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")
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/hicolor/*-apps-ksirk.png")
ecm_add_app_icon(ksirk_SRCS ICONS ${ICONS_SRCS})
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}
iris_ksirk
kdegames
kdegamesprivate
)
Qt5::Xml
Qt5::Svg
qca-qt5
iris_ksirk
KF5::Crash
KF5::IconThemes
KF5::KIOCore
KF5::NewStuff
KF5::Wallet
Phonon::phonon4qt5
KF5KDEGames
KF5KDEGamesPrivate
)
install( TARGETS ksirk ${INSTALL_TARGETS_DEFAULT_ARGS})
install( TARGETS ksirk ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
kde4_install_icons( ${ICON_INSTALL_DIR} )
install( FILES ksirksettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( PROGRAMS org.kde.ksirk.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES ksirkui.rc DESTINATION ${DATA_INSTALL_DIR}/ksirk )
install( FILES jabber.png DESTINATION ${DATA_INSTALL_DIR}/ksirk )
install( FILES ksirk.knsrc DESTINATION ${CONFIG_INSTALL_DIR} )
install(FILES org.kde.ksirk.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo/ )
install(FILES ksirksettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(PROGRAMS org.kde.ksirk.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ksirkui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/ksirk)
install(FILES jabber.png DESTINATION ${KDE_INSTALL_DATADIR}/ksirk)
install(FILES ksirk.knsrc DESTINATION ${KDE_INSTALL_CONFDIR})
install(FILES org.kde.ksirk.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
......@@ -62,25 +62,19 @@
// include files for KDE
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <klocale.h>
#include <KLocalizedString>
#include <kconfig.h>
#include <kstandardgameaction.h>
#include <kstandardaction.h>
#include <kactioncollection.h>
#include <kstandarddirs.h>
#include <kmenubar.h>
#include <kdebug.h>
#include <ktextedit.h>
#include "ksirk_debug.h"
#include <phonon/mediaobject.h>
#include <KPushButton>
#include <QPushButton>
#include <kgamepopupitem.h>
#include <kglobal.h>
#include <KStatusBar>
#include <KToolBar>
#include <KAction>
#include <QAction>
#include <QSvgRenderer>
#include <KDialog>
#include <QDialog>
#include <KAboutData>
#include <sys/utsname.h>
......@@ -104,13 +98,16 @@ InvasionSlider::InvasionSlider(KGameWindow* game, GameLogic::Country * attack, G
m_nbLArmies = new QLabel(QString::number(m_nbLArmy));
m_nbRArmies = new QLabel(QString::number(m_nbRArmy));
QVBoxLayout* dialogLayout = new QVBoxLayout(this);
QDialogButtonBox* buttonBox = NULL;
if (invasionType == Invasion)
{
setButtons( KDialog::Ok );
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
}
else if (invasionType == Moving)
{
setButtons( KDialog::Cancel | KDialog::Ok );
buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
}
QWidget* widget = new QWidget(this);
......@@ -171,21 +168,23 @@ InvasionSlider::InvasionSlider(KGameWindow* game, GameLogic::Country * attack, G
//val->setText(QString::number(invadeSlide->value()));
connect(m_invadeSlide,SIGNAL(valueChanged(int)),this,SLOT(slideMove(int)));
connect(m_invadeSlide,SIGNAL(sliderReleased()),this,SLOT(slideReleased()));
connect(this,SIGNAL(okClicked()),this,SLOT(slideClose()));
connect(buttonBox,SIGNAL(accepted()),this,SLOT(slideClose()));
if (invasionType == Moving)
{
connect(this,SIGNAL(cancelClicked()),this,SLOT(slideCancel()));
connect(buttonBox,SIGNAL(rejected()),this,SLOT(slideCancel()));
}
setMainWidget(widget);
widget->setLayout(wSlideLayout);
dialogLayout->addWidget(widget);
if (buttonBox)
dialogLayout->addWidget(buttonBox);
setWindowModality(Qt::ApplicationModal);
}
void InvasionSlider::slideMove(int v)
{
kDebug() << v;
qCDebug(KSIRK_LOG) << v;
m_nbLArmy = m_nbLArmy-(v-m_currentSlideValue);
m_nbRArmy = m_nbRArmy+(v-m_currentSlideValue);
m_nbLArmies->setText(QString::number(m_nbLArmy));
......@@ -198,12 +197,12 @@ void InvasionSlider::slideMove(int v)
void InvasionSlider::slideReleased()
{
kDebug() << "do nothing";
qCDebug(KSIRK_LOG) << "do nothing";
}
void InvasionSlider::slideClose()
{
kDebug() << m_currentSlideValue;
qCDebug(KSIRK_LOG) << m_currentSlideValue;
QByteArray buffer;
QDataStream stream(&buffer, QIODevice::WriteOnly);
......@@ -215,13 +214,15 @@ void InvasionSlider::slideClose()
m_game->automaton()->currentPlayerPlayed(true);
QPointF point;
m_game->automaton()->gameEvent("actionNextPlayer", point);
accept();
}
void InvasionSlider::slideCancel()
{
kDebug() << "Move cancel";
qCDebug(KSIRK_LOG) << "Move cancel";
reject();
}
} // closing namespace Ksirk
#include "InvasionSlider.moc"
......@@ -19,7 +19,7 @@
#ifndef INVASIONSLIDER_H
#define INVASIONSLIDER_H
#include <KDialog>
#include <QDialog>
class QLabel;
class QSlider;
......@@ -37,7 +37,7 @@ namespace GameLogic
* @author Gael de Chalendar (aka Kleag)
* @version $Id: kgamewin.h 243 2007-02-24 00:22:58Z kleag $
*/
class InvasionSlider: public KDialog
class InvasionSlider: public QDialog
{
Q_OBJECT
......
......@@ -21,7 +21,7 @@
#include "GameLogic/gameautomaton.h"
#include "ksirksettings.h"
#include <KDebug>
#include "ksirk_debug.h"
#include <KStringHandler>
#include <kwallet.h>
......@@ -35,7 +35,7 @@ KsirkJabberGameWidget::KsirkJabberGameWidget(QWidget* parent) :
m_automaton(0),
m_previousGuiIndex(-1)
{
kDebug();
qCDebug(KSIRK_LOG);
setupUi(this);
stackedWidget->setCurrentIndex(0);
......@@ -82,7 +82,7 @@ KsirkJabberGameWidget::KsirkJabberGameWidget(QWidget* parent) :
void KsirkJabberGameWidget::init(GameAutomaton* automaton)
{
kDebug();
qCDebug(KSIRK_LOG);
m_automaton = automaton;
jabberstateled->setState(
(m_automaton->game()->jabberClient()->isConnected())
......@@ -105,7 +105,7 @@ void KsirkJabberGameWidget::init(GameAutomaton* automaton)
void KsirkJabberGameWidget::slotJabberConnectButtonClicked()
{
kDebug();
qCDebug(KSIRK_LOG);
KsirkSettings::setJabberId(jabberid->text());
XMPP::Jid jid(jabberid->text()+'/'+jabberid->text());
......@@ -126,7 +126,7 @@ void KsirkJabberGameWidget::slotJabberConnectButtonClicked()
delete wallet;
}
KsirkSettings::self()->writeConfig();
KsirkSettings::self()->save();
m_automaton->game()->jabberClient()->setOverrideHost ( true, jid.domain(), 5222 );
JabberClient::ErrorCode res = m_automaton->game()->jabberClient()->connect(jid, pass);
......@@ -134,67 +134,67 @@ void KsirkJabberGameWidget::slotJabberConnectButtonClicked()
switch (res)
{
case JabberClient::Ok:
kDebug() << "Succesfull connexion";
qCDebug(KSIRK_LOG) << "Succesfull connexion";
m_automaton->game()->jabberClient()->requestRoster ();
break;
case JabberClient::InvalidPassword:
kError() << "Password used to connect to the server was incorrect.";
qCCritical(KSIRK_LOG) << "Password used to connect to the server was incorrect.";
break;
case JabberClient::AlreadyConnected:
kError() << "A new connection was attempted while the previous one hasn't been closed.";
qCCritical(KSIRK_LOG) << "A new connection was attempted while the previous one hasn't been closed.";
break;
case JabberClient::NoTLS:
kError() << "Use of TLS has been forced (see @ref forceTLS) but TLS is not available, either server- or client-side.";
qCCritical(KSIRK_LOG) << "Use of TLS has been forced (see @ref forceTLS) but TLS is not available, either server- or client-side.";
break;
case JabberClient::InvalidPasswordForMUC:
kError() << "A password is require to enter on this Multi-User Chat";
qCCritical(KSIRK_LOG) << "A password is require to enter on this Multi-User Chat";
break;
case JabberClient::NicknameConflict:
kError() << "There is already someone with that nick connected to the Multi-User Chat";
qCCritical(KSIRK_LOG) << "There is already someone with that nick connected to the Multi-User Chat";
break;
case JabberClient::BannedFromThisMUC:
kError() << "You can't join this Multi-User Chat because you were bannished";
qCCritical(KSIRK_LOG) << "You can't join this Multi-User Chat because you were bannished";
break;
case JabberClient::MaxUsersReachedForThisMuc:
kError() << "You can't join this Multi-User Chat because it is full";
qCCritical(KSIRK_LOG) << "You can't join this Multi-User Chat because it is full";
break;
default:
kError() << "Unknown error";
qCCritical(KSIRK_LOG) << "Unknown error";
}
}
void KsirkJabberGameWidget::slotJabberDisconnected()
{
kDebug();
qCDebug(KSIRK_LOG);
stackedWidget->setCurrentIndex(0);
jabberstateled->setState(KLed::Off);
}
void KsirkJabberGameWidget::slotJabberError(int error)
{
kDebug() << error;
qCDebug(KSIRK_LOG) << error;
}
void KsirkJabberGameWidget::slotHandleTLSWarning(QCA::TLS::IdentityResult result, QCA::Validity validity)
{
kDebug() << result << validity;
qCDebug(KSIRK_LOG) << result << validity;
}
void KsirkJabberGameWidget::slotJabberConnected()
{
kDebug () << "Connected to Jabber server.";
qCDebug(KSIRK_LOG) << "Connected to Jabber server.";
jabberstateled->setState(KLed::On);
}
void KsirkJabberGameWidget::slotJabberClientError(JabberClient::ErrorCode error)
{
kDebug() << error;
qCDebug(KSIRK_LOG) << error;
}
void KsirkJabberGameWidget::slotRosterRequestFinished ( bool success )
{
kDebug() << success;
qCDebug(KSIRK_LOG) << success;
if ( success )
{
stackedWidget->setCurrentIndex(1);
......@@ -203,7 +203,7 @@ void KsirkJabberGameWidget::slotRosterRequestFinished ( bool success )
void KsirkJabberGameWidget::slotJoinRoom()
{
kDebug () << "Joining group chat...";
qCDebug(KSIRK_LOG) << "Joining group chat...";
XMPP::Jid roomJid(roomjid->text());
QString groupchatHost = roomJid.domain();
m_automaton->game()->setGroupchatHost(groupchatHost);
......@@ -228,7 +228,7 @@ void KsirkJabberGameWidget::slotJoinRoom()
}
delete wallet;
}
KsirkSettings::self()->writeConfig();
KsirkSettings::self()->save();
if (groupchatPassword.isEmpty())
......@@ -239,10 +239,10 @@ void KsirkJabberGameWidget::slotJoinRoom()
void KsirkJabberGameWidget::slotGroupChatJoined(const XMPP::Jid & jid)
{
kDebug() << jid.full();
qCDebug(KSIRK_LOG) << jid.full();
chatroomstateled->setState(KLed::On);
kDebug () << "Joined groupchat " << jid.full ();
qCDebug(KSIRK_LOG) << "Joined groupchat " << jid.full ();
startnewgamebutton->setEnabled(true);
joingamebutton->setEnabled(true);
......@@ -251,7 +251,7 @@ void KsirkJabberGameWidget::slotGroupChatJoined(const XMPP::Jid & jid)
void KsirkJabberGameWidget::slotGroupChatLeft (const XMPP::Jid & jid)
{
kDebug();
qCDebug(KSIRK_LOG);
Q_UNUSED(jid);
chatroomstateled->setState(KLed::Off);
......@@ -262,7 +262,7 @@ void KsirkJabberGameWidget::slotGroupChatLeft (const XMPP::Jid & jid)
void KsirkJabberGameWidget::slotGroupChatPresence (const XMPP::Jid & jid, const XMPP::Status & status)
{
kDebug() << jid.full() << status.isAvailable();
qCDebug(KSIRK_LOG) << jid.full() << status.isAvailable();
if (!status.isAvailable())
{
int i = 0;
......@@ -282,7 +282,7 @@ void KsirkJabberGameWidget::slotGroupChatPresence (const XMPP::Jid & jid, const
void KsirkJabberGameWidget::slotGroupChatError (const XMPP::Jid & jid, int error, const QString & reason)
{
kDebug() << jid.full() << error << reason;
qCDebug(KSIRK_LOG) << jid.full() << error << reason;
}
void KsirkJabberGameWidget::slotNewJabberGame(const QString& nick,
......@@ -290,12 +290,12 @@ void KsirkJabberGameWidget::slotNewJabberGame(const QString& nick,
const QString& skin
)
{
kDebug() << nick << nbPlayers << skin;
qCDebug(KSIRK_LOG) << nick << nbPlayers << skin;
for (int i = 0; i < jabberTable->rowCount(); i++)
{
if (jabberTable->itemAt(0,i)->text() == nick)
{
kDebug() << "This game is already listed";
qCDebug(KSIRK_LOG) << "This game is already listed";
return;
}
}
......@@ -315,22 +315,22 @@ void KsirkJabberGameWidget::slotNewJabberGame(const QString& nick,
void KsirkJabberGameWidget::slotCellClicked(int row, int column)
{
Q_UNUSED(column);
kDebug() << row;
qCDebug(KSIRK_LOG) << row;
m_nick = jabberTable->item(row,0)->text();
m_nbPlayers = jabberTable->item(row,2)->text().toInt();
kDebug() << m_nick << m_nbPlayers;
qCDebug(KSIRK_LOG) << m_nick << m_nbPlayers;
}
void KsirkJabberGameWidget::slotJoinJabberGame()
{
kDebug();
qCDebug(KSIRK_LOG);
m_automaton->joinJabberGame(m_nick);
}
void KsirkJabberGameWidget::slotCancel()
{
kDebug();
qCDebug(KSIRK_LOG);
emit cancelled(m_previousGuiIndex);
}
#include "jabbergameui.moc"
......@@ -69,7 +69,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="KPushButton" name="connectbutton">
<widget class="QPushButton" name="connectbutton">
<property name="text">
<string>Connect</string>
</property>
......@@ -175,7 +175,7 @@
</widget>
</item>
<item row="2" column="2">
<widget class="KPushButton" name="joinroombutton">
<widget class="QPushButton" name="joinroombutton">
<property name="text">
<string>Join Room</string>
</property>
......@@ -237,7 +237,7 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="KPushButton" name="startnewgamebutton">
<widget class="QPushButton" name="startnewgamebutton">
<property name="enabled">
<bool>false</bool>
</property>
......@@ -247,7 +247,7 @@