fix crashes for local game (commited with avatar-ignore feature)
This commit is contained in:
@@ -1074,6 +1074,9 @@ void gameTableImpl::refreshPlayerAvatar()
|
|||||||
PlayerList seatsList = currentGame->getSeatsList();
|
PlayerList seatsList = currentGame->getSeatsList();
|
||||||
for (it_c=seatsList->begin(), seatPlace=0; it_c!=seatsList->end(); ++it_c, seatPlace++) {
|
for (it_c=seatsList->begin(), seatPlace=0; it_c!=seatsList->end(); ++it_c, seatPlace++) {
|
||||||
|
|
||||||
|
//set uniqueID
|
||||||
|
playerAvatarLabelArray[(*it_c)->getMyID()]->setMyUniqueId((*it_c)->getMyUniqueID());
|
||||||
|
|
||||||
//get CountryString
|
//get CountryString
|
||||||
QString countryString(QString(myStartWindow->getSession()->getClientPlayerInfo((*it_c)->getMyUniqueID()).countryCode.c_str()).toLower());
|
QString countryString(QString(myStartWindow->getSession()->getClientPlayerInfo((*it_c)->getMyUniqueID()).countryCode.c_str()).toLower());
|
||||||
countryString = QString(":/cflags/cflags/%1.png").arg(countryString);
|
countryString = QString(":/cflags/cflags/%1.png").arg(countryString);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
MyAvatarLabel::MyAvatarLabel(QGroupBox* parent)
|
||||||
: QLabel(parent), voteRunning(false), transparent(false)
|
: QLabel(parent), voteRunning(false), transparent(false), myUniqueId(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
myContextMenu = new QMenu;
|
myContextMenu = new QMenu;
|
||||||
@@ -395,21 +395,14 @@ void MyAvatarLabel::paintEvent(QPaintEvent*)
|
|||||||
painter.setOpacity(1.0);
|
painter.setOpacity(1.0);
|
||||||
|
|
||||||
//hide avatar if player is on ignore list
|
//hide avatar if player is on ignore list
|
||||||
boost::shared_ptr<Game> currentGame = myW->myStartWindow->getSession()->getCurrentGame();
|
boost::shared_ptr<Session> mySession = myW->myStartWindow->getSession();
|
||||||
PlayerListConstIterator it_c;
|
if(!playerIsOnIgnoreList(QString::fromUtf8(mySession->getClientPlayerInfo(myUniqueId).playerName.c_str()))) {
|
||||||
int seatPlace;
|
painter.drawPixmap(0,0,myPixmap);
|
||||||
PlayerList seatsList = currentGame->getSeatsList();
|
return;
|
||||||
for (seatPlace=0,it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c, seatPlace++) {
|
}
|
||||||
if(seatPlace == myId) {
|
else if(myW->getMyConfig()->readConfigInt("DontHideAvatarsOfIgnored")) {
|
||||||
if(!playerIsOnIgnoreList(QString::fromUtf8((*it_c)->getMyName().c_str()))) {
|
painter.drawPixmap(0,0,myPixmap);
|
||||||
painter.drawPixmap(0,0,myPixmap);
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if(myW->getMyConfig()->readConfigInt("DontHideAvatarsOfIgnored")) {
|
|
||||||
painter.drawPixmap(0,0,myPixmap);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ public:
|
|||||||
void setMyId ( int theValue ) {
|
void setMyId ( int theValue ) {
|
||||||
myId = theValue;
|
myId = theValue;
|
||||||
}
|
}
|
||||||
|
void setMyUniqueId ( int theValue ) {
|
||||||
|
myUniqueId = theValue;
|
||||||
|
}
|
||||||
void contextMenuEvent ( QContextMenuEvent * event );
|
void contextMenuEvent ( QContextMenuEvent * event );
|
||||||
QString getPlayerTip(QString);
|
QString getPlayerTip(QString);
|
||||||
int getPlayerRating(QString);
|
int getPlayerRating(QString);
|
||||||
@@ -95,10 +98,12 @@ private:
|
|||||||
QPixmap myPixmap;
|
QPixmap myPixmap;
|
||||||
QString myPath;
|
QString myPath;
|
||||||
|
|
||||||
int myId;
|
|
||||||
bool myContextMenuEnabled;
|
bool myContextMenuEnabled;
|
||||||
bool voteRunning;
|
bool voteRunning;
|
||||||
bool transparent;
|
bool transparent;
|
||||||
|
int myId;
|
||||||
|
int myUniqueId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#ifndef ANDROID_TEST
|
#ifndef ANDROID_TEST
|
||||||
#include "QtGui/5.1.0/QtGui/qpa/qplatformnativeinterface.h"
|
#include "QtGui/5.1.1/QtGui/qpa/qplatformnativeinterface.h"
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user