Running astyle.
This commit is contained in:
@@ -79,8 +79,7 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
|||||||
int api = -2;
|
int api = -2;
|
||||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||||
qCritical()<<"AttachCurrentThread failed";
|
qCritical()<<"AttachCurrentThread failed";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
|
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
|
||||||
if (jclassApplicationClass) {
|
if (jclassApplicationClass) {
|
||||||
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
|
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
|
||||||
|
|||||||
@@ -119,12 +119,10 @@ bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
|
||||||
this->reject();
|
this->reject();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// pass the event on to the parent class
|
// pass the event on to the parent class
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,12 +123,10 @@ bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
|
||||||
this->reject();
|
this->reject();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// pass the event on to the parent class
|
// pass the event on to the parent class
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,8 @@ unsigned ChatTools::parsePrivateMessageTarget(QString &chatText)
|
|||||||
return playerId;
|
return playerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ChatTools::checkForEmotes(QString msg) {
|
QString ChatTools::checkForEmotes(QString msg)
|
||||||
|
{
|
||||||
|
|
||||||
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
||||||
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
||||||
|
|||||||
@@ -260,12 +260,10 @@ bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
|
||||||
this->reject();
|
this->reject();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// pass the event on to the parent class
|
// pass the event on to the parent class
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,12 +151,10 @@ bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
|
||||||
this->reject();
|
this->reject();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// pass the event on to the parent class
|
// pass the event on to the parent class
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3744,14 +3744,12 @@ void gameTableImpl::changeSpinBoxBetValue(int value)
|
|||||||
if(betSliderChangedByInput) {
|
if(betSliderChangedByInput) {
|
||||||
//prevent interval cutting of spinBox_betValue input from code below
|
//prevent interval cutting of spinBox_betValue input from code below
|
||||||
betSliderChangedByInput = FALSE;
|
betSliderChangedByInput = FALSE;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) {
|
if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) {
|
||||||
|
|
||||||
spinBox_betValue->setValue(horizontalSlider_bet->value());
|
spinBox_betValue->setValue(horizontalSlider_bet->value());
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
int temp;
|
int temp;
|
||||||
if(horizontalSlider_bet->maximum() <= 1000 ) {
|
if(horizontalSlider_bet->maximum() <= 1000 ) {
|
||||||
@@ -4390,7 +4388,8 @@ void gameTableImpl::tabsButtonClose()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void gameTableImpl::checkActionLabelPosition() {
|
void gameTableImpl::checkActionLabelPosition()
|
||||||
|
{
|
||||||
#ifndef GUI_800x480
|
#ifndef GUI_800x480
|
||||||
int i;
|
int i;
|
||||||
if(myCardDeckStyle->getBigIndexesActionBottom() == "1") {
|
if(myCardDeckStyle->getBigIndexesActionBottom() == "1") {
|
||||||
@@ -4399,22 +4398,19 @@ void gameTableImpl::checkActionLabelPosition() {
|
|||||||
if(actionLabelArray[i]->y() == 56) {
|
if(actionLabelArray[i]->y() == 56) {
|
||||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 80);
|
actionLabelArray[i]->move(actionLabelArray[i]->x(), 80);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if(actionLabelArray[i]->y() == 43) {
|
if(actionLabelArray[i]->y() == 43) {
|
||||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 67);
|
actionLabelArray[i]->move(actionLabelArray[i]->x(), 67);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(i>=3 && i<=7) {
|
if(i>=3 && i<=7) {
|
||||||
if(actionLabelArray[i]->y() == 80) {
|
if(actionLabelArray[i]->y() == 80) {
|
||||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 56);
|
actionLabelArray[i]->move(actionLabelArray[i]->x(), 56);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if(actionLabelArray[i]->y() == 67) {
|
if(actionLabelArray[i]->y() == 67) {
|
||||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 43);
|
actionLabelArray[i]->move(actionLabelArray[i]->x(), 43);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ public slots:
|
|||||||
void regUserToggled(bool);
|
void regUserToggled(bool);
|
||||||
void guestUserToggled(bool);
|
void guestUserToggled(bool);
|
||||||
void okButtonCheck();
|
void okButtonCheck();
|
||||||
void clickLoginButton() { pushButton_login->click(); }
|
void clickLoginButton() {
|
||||||
|
pushButton_login->click();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@
|
|||||||
|
|
||||||
class UploaderThread;
|
class UploaderThread;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class LogFileDialog;
|
class LogFileDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +45,9 @@ public:
|
|||||||
explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0);
|
explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0);
|
||||||
~LogFileDialog();
|
~LogFileDialog();
|
||||||
|
|
||||||
void setGuiLog(guiLog *g) { myGuiLog = g; }
|
void setGuiLog(guiLog *g) {
|
||||||
|
myGuiLog = g;
|
||||||
|
}
|
||||||
void exec();
|
void exec();
|
||||||
|
|
||||||
virtual void UploadCompleted(const std::string &filename, const std::string &returnMessage);
|
virtual void UploadCompleted(const std::string &filename, const std::string &returnMessage);
|
||||||
@@ -60,8 +63,12 @@ public slots:
|
|||||||
void exportLogToHtml();
|
void exportLogToHtml();
|
||||||
void exportLogToTxt();
|
void exportLogToTxt();
|
||||||
void saveLogFileAs();
|
void saveLogFileAs();
|
||||||
void showLogFilePreviewInit() {showLogFilePreview(INIT_VIEW); }
|
void showLogFilePreviewInit() {
|
||||||
void showLogFilePreviewSelected() {showLogFilePreview(SELECTED_GAME); }
|
showLogFilePreview(INIT_VIEW);
|
||||||
|
}
|
||||||
|
void showLogFilePreviewSelected() {
|
||||||
|
showLogFilePreview(SELECTED_GAME);
|
||||||
|
}
|
||||||
void showLogFilePreview(ShowLogMode);
|
void showLogFilePreview(ShowLogMode);
|
||||||
void keyPressEvent ( QKeyEvent * event );
|
void keyPressEvent ( QKeyEvent * event );
|
||||||
void uploadFile();
|
void uploadFile();
|
||||||
|
|||||||
@@ -100,12 +100,10 @@ bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
event->ignore();
|
event->ignore();
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
|
||||||
this->reject();
|
this->reject();
|
||||||
return true;
|
return true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// pass the event on to the parent class
|
// pass the event on to the parent class
|
||||||
return QDialog::eventFilter(obj, event);
|
return QDialog::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,8 @@ void AndroidAudio::startSoundPlayer()
|
|||||||
// qDebug() << "Created Buffer Player";
|
// qDebug() << "Created Buffer Player";
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidAudio::playSound(const std::string& name, int i) {
|
void AndroidAudio::playSound(const std::string& name, int i)
|
||||||
|
{
|
||||||
|
|
||||||
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ void SDLPlayer::initAudio()
|
|||||||
if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
||||||
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||||
audioEnabled = 1;
|
audioEnabled = 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :(";
|
qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :(";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -134,7 +133,8 @@ void SDLPlayer::playSound(string audioString, int playerID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SDLPlayer::closeAudio()
|
void SDLPlayer::closeAudio()
|
||||||
{ if(audioEnabled) {
|
{
|
||||||
|
if(audioEnabled) {
|
||||||
Mix_HaltChannel(currentChannel);
|
Mix_HaltChannel(currentChannel);
|
||||||
Mix_FreeChunk(sound);
|
Mix_FreeChunk(sound);
|
||||||
sound = NULL;
|
sound = NULL;
|
||||||
|
|||||||
@@ -88,14 +88,12 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
|||||||
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
||||||
if(customStartWindowBgFile.exists()) {
|
if(customStartWindowBgFile.exists()) {
|
||||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png");
|
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png");
|
||||||
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||||
if(pix.save(customStartWindowBgFileString)) {
|
if(pix.save(customStartWindowBgFileString)) {
|
||||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,8 +138,7 @@ void CardDeckStyleReader::readStyleFile(QString file)
|
|||||||
// set loadedSuccessfull TRUE if everything works
|
// set loadedSuccessfull TRUE if everything works
|
||||||
if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) {
|
if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) {
|
||||||
myState = CD_STYLE_OK;
|
myState = CD_STYLE_OK;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
//check for style file version
|
//check for style file version
|
||||||
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) {
|
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) {
|
||||||
myState = CD_STYLE_OUTDATED;
|
myState = CD_STYLE_OUTDATED;
|
||||||
@@ -153,8 +152,7 @@ void CardDeckStyleReader::readStyleFile(QString file)
|
|||||||
}
|
}
|
||||||
loadedSuccessfull = 1;
|
loadedSuccessfull = 1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
loadedSuccessfull = 0;
|
loadedSuccessfull = 0;
|
||||||
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||||
tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
||||||
|
|||||||
@@ -1253,8 +1253,7 @@ void GameTableStyleReader::readStyleFile(QString file)
|
|||||||
}
|
}
|
||||||
loadedSuccessfull = 1;
|
loadedSuccessfull = 1;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
loadedSuccessfull = 0;
|
loadedSuccessfull = 0;
|
||||||
MyMessageBox::warning(myW, tr("Game Table Style Error"),
|
MyMessageBox::warning(myW, tr("Game Table Style Error"),
|
||||||
tr("Cannot load game table style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
tr("Cannot load game table style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
||||||
|
|||||||
@@ -1393,8 +1393,7 @@ void
|
|||||||
ClientStateWaitStart::InternalHandlePacket(boost::shared_ptr<ClientThread> client, boost::shared_ptr<NetPacket> tmpPacket)
|
ClientStateWaitStart::InternalHandlePacket(boost::shared_ptr<ClientThread> client, boost::shared_ptr<NetPacket> tmpPacket)
|
||||||
{
|
{
|
||||||
if (tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartInitialMessage
|
if (tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartInitialMessage
|
||||||
|| tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage)
|
|| tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage) {
|
||||||
{
|
|
||||||
PlayerIdList tmpPlayerList;
|
PlayerIdList tmpPlayerList;
|
||||||
unsigned tmpHandId = 0;
|
unsigned tmpHandId = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ ReceiveBuffer::ScanPackets()
|
|||||||
uint32_t nativeVal;
|
uint32_t nativeVal;
|
||||||
memcpy(&nativeVal, &recvBuf[0], sizeof(uint32_t));
|
memcpy(&nativeVal, &recvBuf[0], sizeof(uint32_t));
|
||||||
size_t packetSize = ntohl(nativeVal);
|
size_t packetSize = ntohl(nativeVal);
|
||||||
if (recvBufUsed >= packetSize + NET_HEADER_SIZE)
|
if (recvBufUsed >= packetSize + NET_HEADER_SIZE) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
tmpPacket = NetPacket::Create(&recvBuf[NET_HEADER_SIZE], packetSize);
|
tmpPacket = NetPacket::Create(&recvBuf[NET_HEADER_SIZE], packetSize);
|
||||||
if (tmpPacket) {
|
if (tmpPacket) {
|
||||||
|
|||||||
Reference in New Issue
Block a user