Running astyle.
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
#include <QtCore>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <QPlatformNativeInterface>
|
||||
#include <jni.h>
|
||||
#include <QPlatformNativeInterface>
|
||||
#include <jni.h>
|
||||
#endif
|
||||
|
||||
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
@@ -79,8 +79,7 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
int api = -2;
|
||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||
qCritical()<<"AttachCurrentThread failed";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
|
||||
if (jclassApplicationClass) {
|
||||
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
|
||||
|
||||
@@ -119,12 +119,10 @@ bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -123,12 +123,10 @@ bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -315,7 +315,8 @@ unsigned ChatTools::parsePrivateMessageTarget(QString &chatText)
|
||||
return playerId;
|
||||
}
|
||||
|
||||
QString ChatTools::checkForEmotes(QString msg) {
|
||||
QString ChatTools::checkForEmotes(QString msg)
|
||||
{
|
||||
|
||||
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
||||
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
||||
|
||||
@@ -260,12 +260,10 @@ bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -151,12 +151,10 @@ bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -1878,7 +1878,7 @@ void gameTableImpl::meInAction()
|
||||
myActionIsRaise = 0;
|
||||
myActionIsBet = 0;
|
||||
|
||||
/* if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||
/* if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
||||
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
||||
} else {
|
||||
@@ -3744,14 +3744,12 @@ void gameTableImpl::changeSpinBoxBetValue(int value)
|
||||
if(betSliderChangedByInput) {
|
||||
//prevent interval cutting of spinBox_betValue input from code below
|
||||
betSliderChangedByInput = FALSE;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) {
|
||||
|
||||
spinBox_betValue->setValue(horizontalSlider_bet->value());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
int temp;
|
||||
if(horizontalSlider_bet->maximum() <= 1000 ) {
|
||||
@@ -4264,9 +4262,9 @@ void gameTableImpl::restoreGameTableGeometry()
|
||||
this->showFullScreen();
|
||||
#else
|
||||
if(myConfig->readConfigInt("GameTableFullScreenSave")) {
|
||||
#ifndef GUI_800x480
|
||||
#ifndef GUI_800x480
|
||||
if(actionFullScreen->isEnabled()) this->showFullScreen();
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
//resize only if style size allow this and if NOT fixed windows size
|
||||
if(!myGameTableStyle->getIfFixedWindowSize().toInt() && myConfig->readConfigInt("GameTableHeightSave") <= myGameTableStyle->getMaximumWindowHeight().toInt() && myConfig->readConfigInt("GameTableHeightSave") >= myGameTableStyle->getMinimumWindowHeight().toInt() && myConfig->readConfigInt("GameTableWidthSave") <= myGameTableStyle->getMaximumWindowWidth().toInt() && myConfig->readConfigInt("GameTableWidthSave") >= myGameTableStyle->getMinimumWindowWidth().toInt()) {
|
||||
@@ -4390,7 +4388,8 @@ void gameTableImpl::tabsButtonClose()
|
||||
#endif
|
||||
|
||||
|
||||
void gameTableImpl::checkActionLabelPosition() {
|
||||
void gameTableImpl::checkActionLabelPosition()
|
||||
{
|
||||
#ifndef GUI_800x480
|
||||
int i;
|
||||
if(myCardDeckStyle->getBigIndexesActionBottom() == "1") {
|
||||
@@ -4399,22 +4398,19 @@ void gameTableImpl::checkActionLabelPosition() {
|
||||
if(actionLabelArray[i]->y() == 56) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 80);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if(actionLabelArray[i]->y() == 43) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 67);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(i>=3 && i<=7) {
|
||||
if(actionLabelArray[i]->y() == 80) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 56);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if(actionLabelArray[i]->y() == 67) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 43);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ public slots:
|
||||
void regUserToggled(bool);
|
||||
void guestUserToggled(bool);
|
||||
void okButtonCheck();
|
||||
void clickLoginButton() { pushButton_login->click(); }
|
||||
void clickLoginButton() {
|
||||
pushButton_login->click();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include <net/uploaderthread.h>
|
||||
|
||||
LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) :
|
||||
QDialog(parent), myConfig(c),
|
||||
ui(new Ui::LogFileDialog)
|
||||
QDialog(parent), myConfig(c),
|
||||
ui(new Ui::LogFileDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
|
||||
class UploaderThread;
|
||||
|
||||
namespace Ui {
|
||||
class LogFileDialog;
|
||||
namespace Ui
|
||||
{
|
||||
class LogFileDialog;
|
||||
}
|
||||
|
||||
enum ShowLogMode { INIT_VIEW, SELECTED_GAME };
|
||||
@@ -44,7 +45,9 @@ public:
|
||||
explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0);
|
||||
~LogFileDialog();
|
||||
|
||||
void setGuiLog(guiLog *g) { myGuiLog = g; }
|
||||
void setGuiLog(guiLog *g) {
|
||||
myGuiLog = g;
|
||||
}
|
||||
void exec();
|
||||
|
||||
virtual void UploadCompleted(const std::string &filename, const std::string &returnMessage);
|
||||
@@ -60,8 +63,12 @@ public slots:
|
||||
void exportLogToHtml();
|
||||
void exportLogToTxt();
|
||||
void saveLogFileAs();
|
||||
void showLogFilePreviewInit() {showLogFilePreview(INIT_VIEW); }
|
||||
void showLogFilePreviewSelected() {showLogFilePreview(SELECTED_GAME); }
|
||||
void showLogFilePreviewInit() {
|
||||
showLogFilePreview(INIT_VIEW);
|
||||
}
|
||||
void showLogFilePreviewSelected() {
|
||||
showLogFilePreview(SELECTED_GAME);
|
||||
}
|
||||
void showLogFilePreview(ShowLogMode);
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void uploadFile();
|
||||
|
||||
@@ -100,12 +100,10 @@ bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
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();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ signals:
|
||||
|
||||
public slots:
|
||||
|
||||
void registerSound(const QString&, const QString&){}
|
||||
void reallyPlaySound(const QString&){}
|
||||
void playSound(const std::string&, int){}
|
||||
void initAudio(){}
|
||||
void closeAudio(){}
|
||||
void reInit(){}
|
||||
void registerSound(const QString&, const QString&) {}
|
||||
void reallyPlaySound(const QString&) {}
|
||||
void playSound(const std::string&, int) {}
|
||||
void initAudio() {}
|
||||
void closeAudio() {}
|
||||
void reInit() {}
|
||||
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
|
||||
@@ -166,7 +166,8 @@ void AndroidAudio::startSoundPlayer()
|
||||
// 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")) {
|
||||
|
||||
|
||||
@@ -52,8 +52,7 @@ void SDLPlayer::initAudio()
|
||||
if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
||||
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||
audioEnabled = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :(";
|
||||
}
|
||||
}
|
||||
@@ -134,7 +133,8 @@ void SDLPlayer::playSound(string audioString, int playerID)
|
||||
}
|
||||
|
||||
void SDLPlayer::closeAudio()
|
||||
{ if(audioEnabled) {
|
||||
{
|
||||
if(audioEnabled) {
|
||||
Mix_HaltChannel(currentChannel);
|
||||
Mix_FreeChunk(sound);
|
||||
sound = NULL;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <SDL/SDL_mixer.h>
|
||||
#endif
|
||||
|
||||
struct Mix_Chunk;
|
||||
struct Mix_Chunk;
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "soundevents.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
#include "androidapi8dummy.h"
|
||||
#else
|
||||
#include "androidaudio.h"
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
#include "androidapi8dummy.h"
|
||||
#else
|
||||
#include "sdlplayer.h"
|
||||
#include "androidaudio.h"
|
||||
#endif
|
||||
#else
|
||||
#include "sdlplayer.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,11 +22,11 @@ SoundEvents::SoundEvents(ConfigFile *c): myConfig(c), lastSBValue(0), lastSBLeve
|
||||
{
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
#ifdef ANDROID_API8
|
||||
myPlayer = new AndroidApi8Dummy(myConfig);
|
||||
#else
|
||||
#else
|
||||
myPlayer = new AndroidAudio(myConfig);
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
myPlayer = new SDLPlayer(myConfig);
|
||||
#endif
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include <string>
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
class AndroidApi8Dummy;
|
||||
#else
|
||||
class AndroidAudio;
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
class AndroidApi8Dummy;
|
||||
#else
|
||||
class SDLPlayer;
|
||||
class AndroidAudio;
|
||||
#endif
|
||||
#else
|
||||
class SDLPlayer;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ protected:
|
||||
private:
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
#ifdef ANDROID_API8
|
||||
AndroidApi8Dummy *myPlayer;
|
||||
#else
|
||||
#else
|
||||
AndroidAudio *myPlayer;
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
SDLPlayer *myPlayer;
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
this->setStatusBar(0);
|
||||
|
||||
#ifdef GUI_800x480
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID
|
||||
this->menubar->hide();
|
||||
|
||||
//check if custom background picture for the resolution is there. Otherwise create it!
|
||||
@@ -88,24 +88,22 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
||||
if(customStartWindowBgFile.exists()) {
|
||||
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");
|
||||
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
if(pix.save(customStartWindowBgFileString)) {
|
||||
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;}");
|
||||
}
|
||||
|
||||
}
|
||||
this->showFullScreen();
|
||||
#else
|
||||
#else
|
||||
// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
|
||||
this->menubar->hide();
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
#endif
|
||||
#endif
|
||||
pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
|
||||
@@ -138,8 +138,7 @@ void CardDeckStyleReader::readStyleFile(QString file)
|
||||
// set loadedSuccessfull TRUE if everything works
|
||||
if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OK;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
//check for style file version
|
||||
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OUTDATED;
|
||||
@@ -153,8 +152,7 @@ void CardDeckStyleReader::readStyleFile(QString file)
|
||||
}
|
||||
loadedSuccessfull = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
loadedSuccessfull = 0;
|
||||
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),
|
||||
|
||||
@@ -1253,8 +1253,7 @@ void GameTableStyleReader::readStyleFile(QString file)
|
||||
}
|
||||
loadedSuccessfull = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
loadedSuccessfull = 0;
|
||||
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),
|
||||
|
||||
@@ -1393,8 +1393,7 @@ void
|
||||
ClientStateWaitStart::InternalHandlePacket(boost::shared_ptr<ClientThread> client, boost::shared_ptr<NetPacket> tmpPacket)
|
||||
{
|
||||
if (tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartInitialMessage
|
||||
|| tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage)
|
||||
{
|
||||
|| tmpPacket->GetMsg()->messagetype() == PokerTHMessage::Type_GameStartRejoinMessage) {
|
||||
PlayerIdList tmpPlayerList;
|
||||
unsigned tmpHandId = 0;
|
||||
|
||||
|
||||
@@ -85,8 +85,7 @@ ReceiveBuffer::ScanPackets()
|
||||
uint32_t nativeVal;
|
||||
memcpy(&nativeVal, &recvBuf[0], sizeof(uint32_t));
|
||||
size_t packetSize = ntohl(nativeVal);
|
||||
if (recvBufUsed >= packetSize + NET_HEADER_SIZE)
|
||||
{
|
||||
if (recvBufUsed >= packetSize + NET_HEADER_SIZE) {
|
||||
try {
|
||||
tmpPacket = NetPacket::Create(&recvBuf[NET_HEADER_SIZE], packetSize);
|
||||
if (tmpPacket) {
|
||||
|
||||
Reference in New Issue
Block a user