Commit b3db63bc authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Fix minor EBN issues

Summary: http://ebn.kde.org/krazy/reports/kde-4.x/kdegames/ksirk/index.html

Test Plan: Compiles, installs, played one game.

Reviewers: #kde_games, aacid

Reviewed By: aacid

Subscribers: aacid, kde-games-devel

Differential Revision: https://phabricator.kde.org/D25825
parent 9b9f031f
......@@ -17,8 +17,8 @@
02110-1301, USA
*/
#ifndef JABBERGAMEWIDGET_H
#define JABBERGAMEWIDGET_H
#ifndef JABBERGAMEUI_H
#define JABBERGAMEUI_H
#include "ui_jabbergameui.h"
#include "Jabber/jabberclient.h"
......@@ -38,7 +38,7 @@ class KsirkJabberGameWidget : public QWidget, public Ui::KsirkJabberGameWidget
{
Q_OBJECT
public:
KsirkJabberGameWidget(QWidget* parent);
explicit KsirkJabberGameWidget(QWidget* parent);
~KsirkJabberGameWidget() override {}
......
......@@ -22,8 +22,8 @@
#define KDE_NO_COMPAT
#ifndef KPLAYERSETUPDIALOG_H
#define KPLAYERSETUPDIALOG_H
#ifndef KPLAYERSETUPWIDGET_H
#define KPLAYERSETUPWIDGET_H
#include "ui_qplayersetupdialog.h"
......@@ -52,7 +52,7 @@ class KPlayerSetupWidget : public QWidget, public Ui::QPlayerSetupWidget
{
Q_OBJECT
public:
KPlayerSetupWidget(QWidget *parent=0);
explicit KPlayerSetupWidget(QWidget *parent=0);
~KPlayerSetupWidget() override;
......@@ -106,4 +106,4 @@ private:
}
#endif // KPLAYERSETUPDIALOG_H
#endif // KPLAYERSETUPWIDGET_H
......@@ -46,7 +46,7 @@ class NewGameWidget : public QWidget, public Ui::NewGameDialog
{
Q_OBJECT
public:
NewGameWidget(NewGameSetup* newGameSetup, QWidget *parent=0);
explicit NewGameWidget(NewGameSetup* newGameSetup, QWidget *parent=0);
~NewGameWidget() override;
......
......@@ -48,7 +48,7 @@ class NewGameSummaryWidget : public QWidget, public Ui::NewGameSummary
{
Q_OBJECT
public:
NewGameSummaryWidget(QWidget *parent=0);
explicit NewGameSummaryWidget(QWidget *parent=0);
~NewGameSummaryWidget() override;
......
......@@ -39,7 +39,7 @@ class RestartOrExitDialogImpl : public QDialog, public Ui::RestartOrExitDialog
{
Q_OBJECT
public:
RestartOrExitDialogImpl(
explicit RestartOrExitDialogImpl(
const QString& label,
QWidget *parent=0);
~RestartOrExitDialogImpl() override;
......
......@@ -34,7 +34,7 @@ class TcpConnectWidget : public QWidget, public Ui::TcpConnectWidget
{
Q_OBJECT
public:
TcpConnectWidget(QWidget *parent=0);
explicit TcpConnectWidget(QWidget *parent=0);
~TcpConnectWidget() override;
......
......@@ -59,13 +59,13 @@ public:
m_order_it++;
return *this;
}
bool operator==(const iterator& it)
bool operator==(const iterator& it) const
{
return ( (m_pixmaps_it == it.m_pixmaps_it)
&& (m_strings_it == it.m_strings_it)
&& (m_order_it == it.m_order_it) );
}
bool operator!=(const iterator& it)
bool operator!=(const iterator& it) const
{
return !((*this)==it);
}
......
......@@ -387,7 +387,7 @@ const Continent* AIColsonPlayer::computeChoiceOfContinent(void)
int max = 0;
int bonus = 0;
for (continentsIt = m_world->getContinents().begin();
continentsIt!=continentsIt_end; continentsIt++)
continentsIt!=continentsIt_end; ++continentsIt)
{
const Continent* continent = *continentsIt;
if (piCount[*it][continent] > 0)
......@@ -1195,7 +1195,7 @@ bool AIColsonPlayer::Place()
/* Try to conquier an entire continent */
for (int iCountry = 0;
iCountry < m_world->getCountries().size();
iCountry++)
++iCountry)
{
if ((RISK_GetOwnerOfCountry(iCountry) == this) &&
(RISK_GetContinentOfCountry(iCountry) == continent) &&
......
......@@ -53,7 +53,7 @@ public:
/**
* Constructor with simple initializations
*/
AIColsonPlayer(
explicit AIColsonPlayer(
const QString & nomPlayer, unsigned int nbArmies,
Nationality * myNation, PlayersArray& players, ONU* world,
GameAutomaton* game );
......
......@@ -49,7 +49,7 @@ public:
/**
* Constructor with simple initializations
*/
AIPlayer(
explicit AIPlayer(
const QString & nomPlayer, unsigned int nbArmies,
Nationality * myNation, PlayersArray& players, ONU* world,
GameAutomaton* game );
......@@ -137,7 +137,7 @@ protected: // Private attributes
void run () override;
public:
MyThread(AIPlayer& p) : me(p) {}
explicit MyThread(AIPlayer& p) : me(p) {}
void setStopMe ( bool value ) { stopMe = value; }
private:
/** indicates to the thread if the run method should return */
......
......@@ -39,7 +39,7 @@ class AIPlayerIO : public KGameIO
{
public:
/** Constructor of the IO device for the given AI player. */
AIPlayerIO(AIPlayer* aiplayer);
explicit AIPlayerIO(AIPlayer* aiplayer);
/** Default destructor. */
~AIPlayerIO() override;
......
......@@ -441,7 +441,7 @@ GameAutomaton::GameState GameAutomaton::run()
qCDebug(KSIRK_LOG) << "Nb Local:" << nbLocal;
stream << nbLocal;
for (it = playerList()->begin(); it != it_end; it++)
for (it = playerList()->begin(); it != it_end; ++it)
{
if ( !((Player*)(*it))->isVirtual() )
{
......@@ -2068,7 +2068,7 @@ void GameAutomaton::slotNetworkData(int msgid, const QByteArray &buffer, quint32
if (sender == gameId()) break;
stream >> statusBarId >> logStatus >> messagePartsNb;
qCDebug(KSIRK_LOG) << "Got ChangeItem on " << statusBarId << " ; nb= " << messagePartsNb << endl;
for (messagePartsCounter = 0; messagePartsCounter < messagePartsNb; messagePartsCounter++)
for (messagePartsCounter = 0; messagePartsCounter < messagePartsNb; ++messagePartsCounter)
{
stream >> elemType;
if (elemType == KMessageParts::Text)
......
......@@ -227,7 +227,7 @@ QString Goal::message(int displayType) const
case Goal::Continents:
foreach (const QString& continent, m_continents)
{
if (continent != QString())
if (!continent.isEmpty())
{
qCDebug(KSIRK_LOG) << " arg = '" << continent << "'" << endl;
res=res.subs(i18n(continent.toUtf8().data()));
......@@ -463,7 +463,7 @@ void Goal::saveXml(QTextStream& xmlStream) const
itc = continents().constBegin(); itc_end = continents().constEnd();
for (; itc != itc_end; itc++)
{
QString name = (*itc==QString())?"":(*itc);
QString name = ((*itc).isEmpty())?"":(*itc);
xmlStream << "<continent name=\"" << name << "\"/>" << endl;
}
xmlStream << "</continents>" << endl;
......
......@@ -61,7 +61,7 @@ public:
GoalAdvance = 2 /**< The advance step. */
};
Goal(GameAutomaton* automaton);
explicit Goal(GameAutomaton* automaton);
/** Copy constructor */
Goal(const Goal& goal);
......
......@@ -42,7 +42,7 @@ class ArenaAction : public QAction
Q_OBJECT
public:
ArenaAction(QObject* parent = 0) : QAction(parent), m_arenaEnabled(false) {}
ArenaAction(const QString& text, QObject* parent = 0) : QAction(text, parent), m_arenaEnabled(false) {}
explicit ArenaAction(const QString& text, QObject* parent = 0) : QAction(text, parent), m_arenaEnabled(false) {}
inline bool isArenaEnabled() {return m_arenaEnabled;}
inline void setArenaEnabled(bool value) {m_arenaEnabled = value;}
private:
......
......@@ -128,7 +128,7 @@ public:
/**
* Create the window and initializes its members
*/
KGameWindow(QWidget* parent=0);
explicit KGameWindow(QWidget* parent=0);
/**
* Deletes the background and the pool
......
......@@ -951,7 +951,7 @@ void KGameWindow::slotReceivedMessage (const XMPP::Message & message)
{
qCDebug(KSIRK_LOG) << "my jid:" << m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick;
XMPP::Jid jid ( message.from().domain() );
if (body.startsWith("I'm starting a game with skin")
if (body.startsWith(QLatin1String("I'm starting a game with skin"))
&& m_presents.contains(message.from().full ())
&& message.from().full() != m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick)
{
......@@ -963,7 +963,7 @@ void KGameWindow::slotReceivedMessage (const XMPP::Message & message)
qCDebug(KSIRK_LOG) << "emiting newJabberGame" << nick << nbPlayers << skin;
emit newJabberGame(nick, nbPlayers, skin);
}
else if (body.startsWith("Who propose online KsirK games here?"))
else if (body.startsWith(QLatin1String("Who propose online KsirK games here?")))
{
qCDebug(KSIRK_LOG) << "online games question" << m_automaton->stateName();
if (m_automaton->startingGame())
......
......@@ -46,7 +46,7 @@ class mainMenu : public QWidget, public Ui::MainMenu
Q_OBJECT
public:
mainMenu(Ksirk::KGameWindow* game, QWidget* parent = 0);
explicit mainMenu(Ksirk::KGameWindow* game, QWidget* parent = 0);
~mainMenu() override {}
......
......@@ -42,7 +42,7 @@ public:
/**
* Constructor
*/
KsirkSkinEditorConfigurationDialog (
explicit KsirkSkinEditorConfigurationDialog (
QWidget *parent, const char *name, KConfigSkeleton *config,
FaceType faceType=List,
QDialogButtonBox::StandardButtons dialogButtons=QDialogButtonBox::RestoreDefaults|QDialogButtonBox::Ok|QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help,
......
......@@ -27,7 +27,7 @@
class KsirkContinentDefinitionWidget : public QDockWidget, public Ui::KsirkContinentDefinition
{
public:
KsirkContinentDefinitionWidget(QWidget* parent) : QDockWidget(parent)
explicit KsirkContinentDefinitionWidget(QWidget* parent) : QDockWidget(parent)
{
setupUi(this);
}
......
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