Remove asserts and make cppcheck happy.

This commit is contained in:
lotodore
2015-01-13 22:21:11 +01:00
parent a212e5c037
commit 6dff34a589
3 changed files with 1 additions and 12 deletions
-8
View File
@@ -875,7 +875,6 @@ void gameTableImpl::initGui(int speed)
//set WindowTitle dynamically
QString titleString = "";
assert(myStartWindow->getSession());
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
titleString = QString::fromUtf8(info.name.c_str())+" - ";
@@ -938,7 +937,6 @@ void gameTableImpl::initGui(int speed)
boost::shared_ptr<Session> gameTableImpl::getSession()
{
assert(myStartWindow->getSession().get());
return myStartWindow->getSession();
}
@@ -1959,8 +1957,6 @@ void gameTableImpl::meInAction()
void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec)
{
assert(playerId >= 0 && playerId < myStartWindow->getSession()->getCurrentGame()->getStartQuantityPlayers());
//beep for player 0
if(playerId) {
timeoutLabelArray[playerId]->startTimeOutAnimation(timeoutSec, false);
@@ -1971,7 +1967,6 @@ void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec)
void gameTableImpl::stopTimeoutAnimation(int playerId)
{
assert(playerId >= 0 && playerId < myStartWindow->getSession()->getCurrentGame()->getStartQuantityPlayers());
timeoutLabelArray[playerId]->stopTimeOutAnimation();
}
@@ -3833,11 +3828,9 @@ void gameTableImpl::leaveCurrentNetworkGame()
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) {
assert(myStartWindow->getSession());
myStartWindow->getSession()->sendLeaveCurrentGame();
} else {
if (myUniversalMessageDialog->exec(BACKTO_LOBBY_QUESTION, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) {
assert(myStartWindow->getSession());
myStartWindow->getSession()->sendLeaveCurrentGame();
}
}
@@ -4473,7 +4466,6 @@ void gameTableImpl::checkActionLabelPosition()
void gameTableImpl::refreshSpectatorsDisplay()
{
assert(myStartWindow->getSession());
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
if(!info.spectatorsDuringGame.empty()) {
spectatorIcon->show();
+1 -3
View File
@@ -71,9 +71,7 @@ MyAvatarLabel::~MyAvatarLabel()
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event )
{
assert(myW->getSession()->getCurrentGame());
if (myW->getSession()->isNetworkClientRunning()) {
if (myW->getSession()->getCurrentGame() && myW->getSession()->isNetworkClientRunning()) {
boost::shared_ptr<PlayerInterface> humanPlayer = myW->getSession()->getCurrentGame()->getSeatsList()->front();
//only active players are allowed to start a vote
-1
View File
@@ -599,7 +599,6 @@ AbstractClientStateReceiving::HandleLobbyMsg(boost::shared_ptr<ClientThread> cli
// Chat message - display it in the GUI.
const ChatMessage &netMessage = lobbyMsg.chatmessage();
string playerName;
if (netMessage.chattype() == ChatMessage::chatTypeBroadcast) {
client->GetCallback().SignalNetClientGameChatMsg("(global notice)", netMessage.chattext());
client->GetCallback().SignalNetClientLobbyChatMsg("(global notice)", netMessage.chattext());