Remove asserts and make cppcheck happy.
This commit is contained in:
@@ -875,7 +875,6 @@ void gameTableImpl::initGui(int speed)
|
|||||||
|
|
||||||
//set WindowTitle dynamically
|
//set WindowTitle dynamically
|
||||||
QString titleString = "";
|
QString titleString = "";
|
||||||
assert(myStartWindow->getSession());
|
|
||||||
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
|
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
|
||||||
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
||||||
titleString = QString::fromUtf8(info.name.c_str())+" - ";
|
titleString = QString::fromUtf8(info.name.c_str())+" - ";
|
||||||
@@ -938,7 +937,6 @@ void gameTableImpl::initGui(int speed)
|
|||||||
|
|
||||||
boost::shared_ptr<Session> gameTableImpl::getSession()
|
boost::shared_ptr<Session> gameTableImpl::getSession()
|
||||||
{
|
{
|
||||||
assert(myStartWindow->getSession().get());
|
|
||||||
return myStartWindow->getSession();
|
return myStartWindow->getSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1959,8 +1957,6 @@ void gameTableImpl::meInAction()
|
|||||||
|
|
||||||
void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec)
|
void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec)
|
||||||
{
|
{
|
||||||
assert(playerId >= 0 && playerId < myStartWindow->getSession()->getCurrentGame()->getStartQuantityPlayers());
|
|
||||||
|
|
||||||
//beep for player 0
|
//beep for player 0
|
||||||
if(playerId) {
|
if(playerId) {
|
||||||
timeoutLabelArray[playerId]->startTimeOutAnimation(timeoutSec, false);
|
timeoutLabelArray[playerId]->startTimeOutAnimation(timeoutSec, false);
|
||||||
@@ -1971,7 +1967,6 @@ void gameTableImpl::startTimeoutAnimation(int playerId, int timeoutSec)
|
|||||||
|
|
||||||
void gameTableImpl::stopTimeoutAnimation(int playerId)
|
void gameTableImpl::stopTimeoutAnimation(int playerId)
|
||||||
{
|
{
|
||||||
assert(playerId >= 0 && playerId < myStartWindow->getSession()->getCurrentGame()->getStartQuantityPlayers());
|
|
||||||
timeoutLabelArray[playerId]->stopTimeOutAnimation();
|
timeoutLabelArray[playerId]->stopTimeOutAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3833,11 +3828,9 @@ void gameTableImpl::leaveCurrentNetworkGame()
|
|||||||
|
|
||||||
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) {
|
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) {
|
||||||
|
|
||||||
assert(myStartWindow->getSession());
|
|
||||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||||
} else {
|
} 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) {
|
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();
|
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4473,7 +4466,6 @@ void gameTableImpl::checkActionLabelPosition()
|
|||||||
|
|
||||||
void gameTableImpl::refreshSpectatorsDisplay()
|
void gameTableImpl::refreshSpectatorsDisplay()
|
||||||
{
|
{
|
||||||
assert(myStartWindow->getSession());
|
|
||||||
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
||||||
if(!info.spectatorsDuringGame.empty()) {
|
if(!info.spectatorsDuringGame.empty()) {
|
||||||
spectatorIcon->show();
|
spectatorIcon->show();
|
||||||
|
|||||||
@@ -71,9 +71,7 @@ MyAvatarLabel::~MyAvatarLabel()
|
|||||||
|
|
||||||
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event )
|
void MyAvatarLabel::contextMenuEvent ( QContextMenuEvent *event )
|
||||||
{
|
{
|
||||||
|
if (myW->getSession()->getCurrentGame() && myW->getSession()->isNetworkClientRunning()) {
|
||||||
assert(myW->getSession()->getCurrentGame());
|
|
||||||
if (myW->getSession()->isNetworkClientRunning()) {
|
|
||||||
|
|
||||||
boost::shared_ptr<PlayerInterface> humanPlayer = myW->getSession()->getCurrentGame()->getSeatsList()->front();
|
boost::shared_ptr<PlayerInterface> humanPlayer = myW->getSession()->getCurrentGame()->getSeatsList()->front();
|
||||||
//only active players are allowed to start a vote
|
//only active players are allowed to start a vote
|
||||||
|
|||||||
@@ -599,7 +599,6 @@ AbstractClientStateReceiving::HandleLobbyMsg(boost::shared_ptr<ClientThread> cli
|
|||||||
// Chat message - display it in the GUI.
|
// Chat message - display it in the GUI.
|
||||||
const ChatMessage &netMessage = lobbyMsg.chatmessage();
|
const ChatMessage &netMessage = lobbyMsg.chatmessage();
|
||||||
|
|
||||||
string playerName;
|
|
||||||
if (netMessage.chattype() == ChatMessage::chatTypeBroadcast) {
|
if (netMessage.chattype() == ChatMessage::chatTypeBroadcast) {
|
||||||
client->GetCallback().SignalNetClientGameChatMsg("(global notice)", netMessage.chattext());
|
client->GetCallback().SignalNetClientGameChatMsg("(global notice)", netMessage.chattext());
|
||||||
client->GetCallback().SignalNetClientLobbyChatMsg("(global notice)", netMessage.chattext());
|
client->GetCallback().SignalNetClientLobbyChatMsg("(global notice)", netMessage.chattext());
|
||||||
|
|||||||
Reference in New Issue
Block a user