Commit cf4d87f6 authored by Gaël de Chalendar's avatar Gaël de Chalendar
Browse files

New fixes of problems reported by the EBN

svn path=/trunk/playground/games/ksirk/; revision=645704
parent 4ceef61e
......@@ -48,13 +48,13 @@ namespace Ksirk
{
KPlayerSetupDialog::KPlayerSetupDialog( GameLogic::ONU* onu,
unsigned int playerNumber, QString &playerName,
unsigned int playerNumber, QString& playerName,
bool network, QString& password,
bool &computerPlayer,
std::map< QString, QString >& nations,
QString& nationName,
QWidget *parent, const char */*name*/) :
QDialog(parent), Ui::QPlayerSetupDialog(/*parent, playerName, true*/), name(playerName),
QDialog(parent), Ui::QPlayerSetupDialog(), name(playerName),
computer(computerPlayer), m_nationName(nationName),
m_nations(nations), m_onu(onu), m_nationsNames(), number(playerNumber),
m_password(password)
......
/**
C++ Implementation: kstringvector
Description:
Author: Gael de Chalendar (aka Kleag) <kleag@free.fr>, (C) 2005
Copyright: See COPYING file that comes with this distribution
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
*/
/* This file is part of KsirK.
* Copyright (C) 2005-2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
*
* KsirK is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#include "KMessageParts.h"
#include "kdebug.h"
......
......@@ -3,7 +3,7 @@
Copyright (C) 2006-2007 Gael de Chalendar <kleag@free.fr>
This file was initialy part of XFrisk
Copyright (C) 1995 and later Jean-Claude Colson and Others
Copyright (C) 1995 and later Jean-Claude Colson and Others <who@nowhere.org>
KsirK is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
......@@ -93,7 +93,7 @@ Fortify();
src = m_world->getCountries().at(Attack_SrcCountry);
if ( (Attack_DestCountry>=0) && (Attack_DestCountry<m_world->getCountries().size() ) )
dest = m_world->getCountries().at(Attack_DestCountry);
// kDebug() << "choosed belligerants " << src << " and " << dest << endl;
// kDebug() << "chose belligerants " << src << " and " << dest << endl;
return std::make_pair(src,dest);
}
......
......@@ -3,7 +3,7 @@
Copyright (C) 2006-2007 Gael de Chalendar <kleag@free.fr>
This file was initialy part of XFrisk
Copyright (C) 1995 and later Jean-Claude Colson and Others
Copyright (C) 1995 and later Jean-Claude Colson and Others <who@nowhere.org>
KsirK is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
......
/**
C++ Implementation: eventslistproperty
Description:
Author: Gael de Chalendar (aka Kleag) <kleag@free.fr>, (C) 2005
Copyright: See COPYING file that comes with this distribution
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
/* This file is part of KsirK.
* Copyright (C) 2005-2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
*
* KsirK is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#include "eventslistproperty.h"
namespace Ksirk {
......
......@@ -2145,7 +2145,7 @@ void GameAutomaton::countriesDistribution()
sendMessage(buffer,CountryOwner);
m_game->setCurrentPlayerToNext(false);
// removes the choosen country number from the vector, thus reducing its size
// removes the chosen country number from the vector, thus reducing its size
vect.erase(it);
}
it = playerList()->begin();
......
/**
C++ Implementation: goal
Description:
Author: Gael de Chalendar (aka Kleag) <kleag@free.fr>, (C) 2005
Copyright: See COPYING file that comes with this distribution
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
*/
/* This file is part of KsirK.
* Copyright (C) 2005-2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
*
* KsirK is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, version 2.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
*/
#include "goal.h"
#include "player.h"
#include "onu.h"
......
......@@ -241,7 +241,7 @@ bool Player::save (QDataStream &stream)
Nationality* Player::getNation()
{
kDebug() << "Player::getNation for " << name() << endl;
if (m_nation == 0 && m_delayedInitNationName != "")
if (m_nation == 0 && !m_delayedInitNationName.isEmpty())
{
kError() << " retrieving delayed nation " << m_delayedInitNationName << endl;
setNation(m_delayedInitNationName);
......
......@@ -237,7 +237,7 @@ protected:
*/
QString m_delayedInitNationName;
/** Used to transmit unique ids and request for an acknowledgement
/** Used to transmit unique ids and request for an acknowledgment
* of their reception. */
static unsigned int m_uid;
......
......@@ -114,7 +114,7 @@ bool GameXmlHandler::startElement( const QString & namespaceURI, const QString &
QString password = atts.value("password");
if (password == "")
if (password.isEmpty())
{
m_game.addPlayer(name, nbAvailArmies, nbCountries, nationName, isAi, password, nbAttack, nbDefense);
}
......@@ -217,7 +217,7 @@ bool GameXmlHandler::startElement( const QString & namespaceURI, const QString &
else if (localName == "continent" && m_inGoal)
{
kDebug() << "Getting id of continent named " << atts.value("name") << endl;
unsigned int id = (atts.value("name")!="") ?
unsigned int id = (!atts.value("name").isEmpty()) ?
m_game.theWorld()->continentNamed(atts.value("name"))->id() :
0;
m_goal->continents().insert(id);
......
/* This file is part of KsirK.
Copyright (C) 2001-2007 Gael de Chalendar <kleag@free.fr>
Copyright (C) 2001-2007 Gael de Chalendar (aka Kleag) <kleag@free.fr>
KsirK is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
......@@ -67,7 +67,7 @@ void KGameWindow::mouseMoveEvent ( QMouseEvent * event )
if (mouseLocalisation)
{
if (countryName != "")
if (!countryName.isEmpty())
{
QString status1Text = "";
const Player* player = mouseLocalisation-> owner();
......@@ -263,7 +263,7 @@ void KGameWindow::slotSaveGame()
if (GameLogic::GameAutomaton::changeable().isAdmin())
{
QString fileName = KFileDialog::getSaveFileName (KUrl(), "*.xml", this, i18n("KsirK - Save Game"));
if (fileName != "")
if (!fileName.isEmpty())
{
std::ofstream ofs(fileName.toUtf8().data());
saveXml(ofs);
......
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