Commit ed7861ed authored by Gael de Chalendar's avatar Gael de Chalendar

Finish removing dependance to KDElibs4Support

Summary: Mostly simple changes like suppressing includes but also a change about socket classes

Reviewers: #kde_games, nhirsl, mlaurent

Reviewed By: nhirsl

Subscribers: #kde_games

Differential Revision: https://phabricator.kde.org/D7044
parent 9b28017b
......@@ -20,7 +20,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
I18n
IconThemes
ItemViews
KDELibs4Support
KIO
NewStuff
NotifyConfig
......
......@@ -132,7 +132,7 @@ target_link_libraries(ksirk
qca-qt5
iris_ksirk
KF5::Crash
KF5::KDELibs4Support
KF5::IconThemes
KF5::KIOCore
KF5::NewStuff
KF5::Wallet
......
......@@ -68,12 +68,9 @@
#include <kstandardaction.h>
#include <kactioncollection.h>
#include "ksirk_debug.h"
#include <ktextedit.h>
#include <phonon/mediaobject.h>
#include <QPushButton>
#include <kgamepopupitem.h>
#include <kglobal.h>
#include <KStatusBar>
#include <KToolBar>
#include <QAction>
#include <QSvgRenderer>
......
......@@ -27,7 +27,7 @@
#include <QStandardPaths>
#include <KMessageBox>
#include <KConfigDialog>
#include <knewstuff3/downloaddialog.h>
#include <downloaddialog.h>
#include <qdir.h>
#include <qstringlist.h>
......
......@@ -39,7 +39,7 @@ NewGameSummaryWidget::NewGameSummaryWidget(QWidget *parent) :
setupUi(this);
connect(previousButton,SIGNAL(clicked()),this,SIGNAL(previous()));
connect(cancelButton,SIGNAL(clicked()),this,SIGNAL(cancel()));
playersTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
playersTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
}
NewGameSummaryWidget::~NewGameSummaryWidget()
......
......@@ -522,7 +522,7 @@ void Country::highlight(const QColor& color, qreal opacity)
(m_anchorPoint.x()-m_highlighting->boundingRect().width()/2)*onu->zoom(),
(m_anchorPoint.y()-m_highlighting->boundingRect().height()/2)*onu->zoom());
m_highlighting->scale(onu->zoom(), onu->zoom());
m_highlighting->setScale(onu->zoom());
// qCDebug(KSIRK_LOG) << "done" << endl;
}
......
......@@ -19,8 +19,6 @@
#ifndef DICE_H
#define DICE_H
#include <kapplication.h>
namespace Ksirk
{
......
......@@ -42,10 +42,8 @@
#include <QUuid>
#include <QInputDialog>
#include <KLocalizedString>
#include <kdialog.h>
#include <klineedit.h>
#include <kmessagebox.h>
#include <kvbox.h>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgame/kmessageclient.h>
......
......@@ -32,8 +32,6 @@
#include <QPixmapCache>
#include <QFileInfo>
#include <QMenuBar>
#include <kapplication.h>
#include <kglobal.h>
#include <KLocalizedString>
#include "ksirk_debug.h"
#include <kmessagebox.h>
......
......@@ -48,7 +48,6 @@
#include <kinputdialog.h>
#include <kicon.h>
#include <kactionmenu.h>
#include <kglobal.h>
#include <KComponentData>
#include "jabberconnector.h"
......
......@@ -18,7 +18,6 @@
***************************************************************************/
#include <qobject.h>
#include <ksocketfactory.h>
#include "jabber_protocol_debug.h"
#include "jabberbytestream.h"
// #include "jabberprotocol.h"
......@@ -31,7 +30,7 @@ JabberByteStream::JabberByteStream ( QObject *parent )
// reset close tracking flag
mClosing = false;
mSocket = NULL;
mSocket = nullptr;
}
void JabberByteStream::connect ( QString host, int port )
......@@ -40,13 +39,14 @@ void JabberByteStream::connect ( QString host, int port )
mClosing = false;
mSocket = KSocketFactory::connectToHost("xmpp", host, port);
mSocket = std::make_shared<QTcpSocket>(new QTcpSocket());
mSocket->connectToHost(host, port);
QObject::connect ( mSocket, SIGNAL (error(QAbstractSocket::SocketError)), this, SLOT (slotError(QAbstractSocket::SocketError)) );
QObject::connect ( mSocket, SIGNAL (connected()), this, SLOT (slotConnected()) );
QObject::connect ( mSocket, SIGNAL (disconnected()), this, SLOT (slotConnectionClosed()) );
QObject::connect ( mSocket, SIGNAL (readyRead()), this, SLOT (slotReadyRead()) );
QObject::connect ( mSocket, SIGNAL (bytesWritten(qint64)), this, SLOT (slotBytesWritten(qint64)) );
QObject::connect ( mSocket.get(), SIGNAL (error(QAbstractSocket::SocketError)), this, SLOT (slotError(QAbstractSocket::SocketError)) );
QObject::connect ( mSocket.get(), SIGNAL (connected()), this, SLOT (slotConnected()) );
QObject::connect ( mSocket.get(), SIGNAL (disconnected()), this, SLOT (slotConnectionClosed()) );
QObject::connect ( mSocket.get(), SIGNAL (readyRead()), this, SLOT (slotReadyRead()) );
QObject::connect ( mSocket.get(), SIGNAL (bytesWritten(qint64)), this, SLOT (slotBytesWritten(qint64)) );
}
bool JabberByteStream::isOpen () const
......@@ -67,8 +67,7 @@ void JabberByteStream::close ()
qCDebug(JABBER_PROTOCOL_LOG) << Q_FUNC_INFO << "socket is not null" << endl;
mSocket->close();
qCDebug(JABBER_PROTOCOL_LOG) << Q_FUNC_INFO << "socket closed" << endl;
delete mSocket;
mSocket=NULL;
mSocket=nullptr;
}
}
......@@ -86,15 +85,13 @@ int JabberByteStream::tryWrite ()
QTcpSocket *JabberByteStream::socket () const
{
return mSocket;
return mSocket.get();
}
JabberByteStream::~JabberByteStream ()
{
delete mSocket;
}
void JabberByteStream::slotConnected ()
......
......@@ -22,7 +22,7 @@
#include <bytestream.h>
#include <QTcpSocket>
#include <memory>
/**
@author Kopete Developers
......@@ -57,7 +57,7 @@ private slots:
void slotError ( QAbstractSocket::SocketError );
private:
QTcpSocket *mSocket;
std::shared_ptr<QTcpSocket> mSocket;
bool mClosing;
};
......
......@@ -26,7 +26,6 @@
#include "decoratedgameframe.h"
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <kglobal.h>
#include <kconfig.h>
#include <kconfiggroup.h>
......
......@@ -33,8 +33,6 @@
#include <KLocalizedString>
#include "ksirk_debug.h"
#include <kgamepopupitem.h>
#include <KAction>
#include <KIcon>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgame/kgameio.h>
#include <libkdegamesprivate/kgame/kplayer.h>
......
......@@ -33,7 +33,6 @@
#include <QMouseEvent>
#include <QGraphicsView>
#include <QPixmap>
#include <kglobal.h>
#include <kconfig.h>
#include <kconfiggroup.h>
......
......@@ -39,7 +39,6 @@
// include files for QT
#include <qmetaobject.h>
#include <qdir.h>
#include <qprinter.h>
#include <qpainter.h>
#include <qinputdialog.h>
......
......@@ -113,7 +113,7 @@ public:
return false;
}
arg.data = QMetaType::construct(arg.type, arg_data[n]);
arg.data = QMetaType::construct(arg.type, arg_data[n], 0);
args += arg;
}
......
......@@ -33,7 +33,7 @@ QString Base64::encode(const QByteArray &s)
p[at++] = tbl[b];
p[at++] = tbl[c];
}
return QString::fromAscii(p);
return QString::fromLatin1(p);
}
QByteArray Base64::decode(const QString& input)
......
......@@ -43,7 +43,7 @@ static QString extractLine(QByteArray *buf, bool *found)
}
else {
// Found newline
QString s = QString::fromAscii(buf->left(index));
QString s = QString::fromLatin1(buf->left(index));
buf->remove(0, index + 2);
if (found)
......
......@@ -148,7 +148,7 @@ void HttpPoll::connectToHost(const QString &proxyHost, int proxyPort, const QStr
d->port = u.port();
else
d->port = 80;
d->url = u.path() + "?" + u.encodedQuery();
d->url = u.path() + "?" + u.query(QUrl::FullyEncoded);
d->use_proxy = false;
}
......
......@@ -97,7 +97,7 @@ QDateTime stamp2TS(const QString &ts)
int sec = ts.mid(15,2).toInt();
QDate xd;
xd.setYMD(year, month, day);
xd.setDate(year, month, day);
if(!xd.isValid())
return QDateTime();
......
......@@ -64,8 +64,6 @@
#include <QMenuBar>
// include files for KDE
#include <KUrl>
#include <K4AboutData>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <KLocalizedString>
......@@ -77,8 +75,7 @@
#include <phonon/mediaobject.h>
#include <QPushButton>
#include <kgamepopupitem.h>
#include <kglobal.h>
#include <KStatusBar>
#include <QStatusBar>
#include <KToolBar>
#include <QAction>
#include <QSvgRenderer>
......@@ -231,6 +228,10 @@ KGameWindow::KGameWindow(QWidget* parent) :
m_mainMenu = new mainMenu(this, m_centralWidget);
m_mainMenu->init(m_theWorld);
/// @FIXME Hides the "Play KsirK over Jabber Network" button while Jabber
/// connection does not work
m_mainMenu->pbJabberGame->hide();
m_newGameDialog = new NewGameWidget(m_newGameSetup, m_centralWidget);
connect(m_newGameDialog,SIGNAL(newGameOK()), this, SLOT(slotNewGameNext()));
connect(m_newGameDialog,SIGNAL(newGameKO()), this, SLOT(slotNewGameKO()));
......
......@@ -49,7 +49,6 @@
#include <ksharedconfig.h>
#include <KXmlGuiWindow>
#include <QStandardPaths>
#include <KShortcut>
// #include <kdialogbase.h>
......
......@@ -59,11 +59,8 @@
#include <kconfig.h>
#include "ksirk_debug.h"
#include <kmessagebox.h>
#include <KStatusBar>
#include <kcomponentdata.h>
#include <kgamepopupitem.h>
#include <KPasswordDialog>
#include <KInputDialog>
#include <tcpconnectwidget.h>
namespace Ksirk
......
......@@ -31,7 +31,6 @@
#include <QPixmap>
#include <QString>
#include <QGridLayout>
#include <kcmdlineargs.h>
#include <QScrollBar>
#include <QScrollArea>
#include <QPalette>
......
......@@ -34,7 +34,6 @@
#include <QDockWidget>
#include <QList>
#include <QLabel>
#include <kglobal.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <QPushButton>
......
......@@ -51,10 +51,10 @@ add_executable(ksirkskineditor ${ksirkskineditor_SRCS})
target_link_libraries(ksirkskineditor
Qt5::Xml
Qt5::Svg
KF5::IconThemes
KF5::KIOCore
Phonon::phonon4qt5
KF5::XmlGui
KF5::KDELibs4Support
KF5KDEGames
KF5KDEGamesPrivate
${CRYPT_LIBS}
......
......@@ -22,20 +22,15 @@
#include "ui_preferences.h"
#include <kconfig.h>
#include <kurl.h>
#include <kedittoolbar.h>
#include "ksirkskineditor_debug.h"
#include <QPushButton>
#include <kstandardaction.h>
#include <klibloader.h>
#include <kmessagebox.h>
#include <kstatusbar.h>
#include <KLocalizedString>
#include <kconfigdialog.h>
#include <kapplication.h>
#include <qslider.h>
#include <qcheckbox.h>
#include <iostream>
......
......@@ -54,13 +54,14 @@ int main(int argc, char *argv[])
i18n("For help and user manual, please see\nThe KsirK Web site"),
QStringLiteral("http://games.kde.org/game.php?game=ksirk"));
aboutData.addAuthor(i18n("Gael de Chalendar aka Kleag"),QString(), "kleag@free.fr");
QApplication::setWindowIcon(QIcon::fromTheme("preferences-desktop-locale"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
//PORTING SCRIPT: adapt aboutdata variable if necessary
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[File]"), i18n("file to open")));
parser.addOption(QCommandLineOption(QStringList() << QLatin1String("+[File]"), i18n("file to open")));
aboutData.setupCommandLine(&parser);
parser.process(app);
......
......@@ -59,10 +59,8 @@
#include <kstandardaction.h>
#include <kactioncollection.h>
#include "ksirkskineditor_debug.h"
#include <ktextedit.h>
#include <phonon/mediaobject.h>
#include <QPushButton>
#include <kglobal.h>
#include <QStatusBar>
#include <KToolBar>
#include <QAction>
......
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