Running astyle.

This commit is contained in:
lotodore
2013-10-06 16:30:09 +02:00
parent c8939fdbdf
commit f0f3d2eb04
44 changed files with 201 additions and 200 deletions
+16 -16
View File
@@ -34,10 +34,10 @@
#include <QtCore>
#ifdef ANDROID
#ifndef ANDROID_TEST
#include "QtGui/5.1.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h>
#endif
#ifndef ANDROID_TEST
#include "QtGui/5.1.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h>
#endif
#endif
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
@@ -71,19 +71,19 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
#ifdef ANDROID
int api = -2;
#ifndef ANDROID_TEST
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForIntegration("JavaVM");
JNIEnv* env;
if (currVM->AttachCurrentThread(&env, NULL)<0) {
qCritical()<<"AttachCurrentThread failed";
} else {
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
if (jclassApplicationClass) {
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
}
currVM->DetachCurrentThread();
#ifndef ANDROID_TEST
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForIntegration("JavaVM");
JNIEnv* env;
if (currVM->AttachCurrentThread(&env, NULL)<0) {
qCritical()<<"AttachCurrentThread failed";
} else {
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
if (jclassApplicationClass) {
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
}
#endif
currVM->DetachCurrentThread();
}
#endif
label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api)));
#else
label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
@@ -1041,7 +1041,8 @@ void gameLobbyDialogImpl::addConnectedPlayer(unsigned playerId, QString playerNa
refreshConnectedPlayerAvatars();
}
void gameLobbyDialogImpl::addConnectedSpectator(unsigned spectatorId, QString spectatorName) {
void gameLobbyDialogImpl::addConnectedSpectator(unsigned spectatorId, QString spectatorName)
{
QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget_connectedSpectators, 0);
item->setData(0, Qt::UserRole, spectatorId);
@@ -1672,8 +1673,11 @@ void gameLobbyDialogImpl::showNickListContextMenu(QPoint p)
nickListPlayerInGameInfo->setText(playerInGameInfoString);
//prevent admin to total kickban himself
if(playerUid == mySession->getClientUniquePlayerId()) { nickListAdminTotalKickBan->setDisabled(true); }
else { nickListAdminTotalKickBan->setEnabled(true); }
if(playerUid == mySession->getClientUniquePlayerId()) {
nickListAdminTotalKickBan->setDisabled(true);
} else {
nickListAdminTotalKickBan->setEnabled(true);
}
// check for admin and remove admin actions for non-admins
if(!mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
@@ -1693,8 +1697,11 @@ void gameLobbyDialogImpl::showGameListContextMenu(QPoint p)
assert(mySession);
unsigned selectedGameId = myGameListSelectionModel->selectedRows().first().data(Qt::UserRole).toUInt();
if(selectedGameId == mySession->getClientCurrentGameId()) { gameListAdminCloseGame->setDisabled(true); }
else { gameListAdminCloseGame->setEnabled(true); }
if(selectedGameId == mySession->getClientCurrentGameId()) {
gameListAdminCloseGame->setDisabled(true);
} else {
gameListAdminCloseGame->setEnabled(true);
}
// check for admin and remove admin actions for non-admins
if(!mySession->getClientPlayerInfo(mySession->getClientUniquePlayerId()).isAdmin) {
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyGameListTreeWidget : public QTreeWidget
+1 -2
View File
@@ -4482,8 +4482,7 @@ void gameTableImpl::refreshSpectatorsDisplay()
}
spectatorList.remove(spectatorList.size()-4,4);
spectatorIcon->setToolTip(spectatorList);
}
else {
} else {
spectatorIcon->setToolTip("");
spectatorIcon->clear();
}
+1 -1
View File
@@ -48,7 +48,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class guiLog;
+1 -1
View File
@@ -42,7 +42,7 @@
#include <QtGui>
#include <QtSql>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
struct result_struct {
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class GameTableStyleReader;
+3 -4
View File
@@ -397,10 +397,9 @@ void MyAvatarLabel::paintEvent(QPaintEvent*)
//hide avatar if player is on ignore list
boost::shared_ptr<Session> mySession = myW->myStartWindow->getSession();
if(!playerIsOnIgnoreList(QString::fromUtf8(mySession->getClientPlayerInfo(myUniqueId).playerName.c_str()))) {
painter.drawPixmap(0,0,myPixmap);
return;
}
else if(myW->getMyConfig()->readConfigInt("DontHideAvatarsOfIgnored")) {
painter.drawPixmap(0,0,myPixmap);
return;
} else if(myW->getMyConfig()->readConfigInt("DontHideAvatarsOfIgnored")) {
painter.drawPixmap(0,0,myPixmap);
return;
}
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyLeftTabWidget : public QTabWidget
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyMenuBar : public QMenuBar
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyRightTabWidget : public QTabWidget
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
+1 -1
View File
@@ -39,7 +39,7 @@
#include <third_party/boost/timers.hpp>
#endif
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class gameTableImpl;
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
+24 -25
View File
@@ -287,31 +287,30 @@ void LogFileDialog::showLogAnalysis(QString /*filename*/, QString returnMessage)
if (retStr == LOG_UPLOAD_ERROR_STR) {
QString errorId(returnMessage.mid(retStr.size()).trimmed());
serverMsg += "\n" + tr("Failure reason: ");
switch (errorId.toInt())
{
case LOG_UPLOAD_ERROR_NO_FILE :
serverMsg += tr("No file received.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_TOTAL :
serverMsg += tr("File rejected because of too many uploads.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_IP :
serverMsg += tr("File rejected because of too many recent uploads. Please try again later.");
break;
case LOG_UPLOAD_ERROR_FILE_SIZE :
serverMsg += tr("The file is too large.");
break;
case LOG_UPLOAD_ERROR_FILE_EXT :
case LOG_UPLOAD_ERROR_FILE_HEAD :
serverMsg += tr("This file is not a valid and current PokerTH log file.");
break;
case LOG_UPLOAD_ERROR_OPEN_DB :
case LOG_UPLOAD_ERROR_ID :
case LOG_UPLOAD_ERROR_FILE_MOVE :
case LOG_UPLOAD_ERROR_INSERT_DB :
default :
serverMsg += tr("Internal error. Please try again later. ID: ") + returnMessage;
break;
switch (errorId.toInt()) {
case LOG_UPLOAD_ERROR_NO_FILE :
serverMsg += tr("No file received.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_TOTAL :
serverMsg += tr("File rejected because of too many uploads.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_IP :
serverMsg += tr("File rejected because of too many recent uploads. Please try again later.");
break;
case LOG_UPLOAD_ERROR_FILE_SIZE :
serverMsg += tr("The file is too large.");
break;
case LOG_UPLOAD_ERROR_FILE_EXT :
case LOG_UPLOAD_ERROR_FILE_HEAD :
serverMsg += tr("This file is not a valid and current PokerTH log file.");
break;
case LOG_UPLOAD_ERROR_OPEN_DB :
case LOG_UPLOAD_ERROR_ID :
case LOG_UPLOAD_ERROR_FILE_MOVE :
case LOG_UPLOAD_ERROR_INSERT_DB :
default :
serverMsg += tr("Internal error. Please try again later. ID: ") + returnMessage;
break;
}
}
MyMessageBox::warning(
@@ -40,7 +40,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class ConfigFile;
@@ -40,7 +40,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class ConfigFile;
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyAvatarButton : public QPushButton
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyHPAvatarButton : public QPushButton
+1 -1
View File
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyStyleListItem : public QTreeWidgetItem
@@ -34,7 +34,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
class MyAvatarListItem : public QListWidgetItem
@@ -37,7 +37,7 @@
#include "ui_selectavatardialog.h"
#endif
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
#include <QtCore>
#include <QtGui>
@@ -42,7 +42,7 @@
#include <QtCore>
#include <QtGui>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
#include <boost/shared_ptr.hpp>
+11 -11
View File
@@ -31,13 +31,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
@@ -52,11 +52,11 @@ SoundEvents::SoundEvents(ConfigFile *c): myConfig(c), lastSBValue(0), lastSBLeve
{
#ifdef ANDROID
#ifdef ANDROID_API8
myPlayer = new AndroidApi8Dummy(myConfig);
#else
myPlayer = new AndroidAudio(myConfig);
#endif
#ifdef ANDROID_API8
myPlayer = new AndroidApi8Dummy(myConfig);
#else
myPlayer = new AndroidAudio(myConfig);
#endif
#else
myPlayer = new SDLPlayer(myConfig);
#endif
+11 -11
View File
@@ -34,13 +34,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
@@ -64,11 +64,11 @@ protected:
private:
#ifdef ANDROID
#ifdef ANDROID_API8
AndroidApi8Dummy *myPlayer;
#else
AndroidAudio *myPlayer;
#endif
#ifdef ANDROID_API8
AndroidApi8Dummy *myPlayer;
#else
AndroidAudio *myPlayer;
#endif
#else
SDLPlayer *myPlayer;
#endif
+28 -27
View File
@@ -60,10 +60,10 @@
#include "guilog.h"
#ifdef ANDROID
#ifndef ANDROID_TEST
#include "QtGui/5.1.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h>
#endif
#ifndef ANDROID_TEST
#include "QtGui/5.1.1/QtGui/qpa/qplatformnativeinterface.h"
#include <jni.h>
#endif
#endif
using namespace std;
@@ -96,25 +96,25 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
this->setStatusBar(0);
#ifdef GUI_800x480
#ifdef ANDROID
this->menubar->hide();
#ifdef ANDROID
this->menubar->hide();
//check if custom background picture for the resolution is there. Otherwise create it!
QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str());
QDesktopWidget dw;
int screenWidth = dw.screenGeometry().width();
int screenHeight = dw.screenGeometry().height();
QString customStartWindowBgFileString(UserDataDir+"/startwindowbg10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
QFile customStartWindowBgFile(customStartWindowBgFileString);
if(customStartWindowBgFile.exists()) {
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: top center; background-origin: content; background-repeat: no-repeat;}");
} else {
//if custom bg file could not be found load the big origin file
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg10_mobile.png); background-position: top center; background-origin: content; background-repeat: no-repeat;}");
}
this->showFullScreen();
//check if custom background picture for the resolution is there. Otherwise create it!
QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str());
QDesktopWidget dw;
int screenWidth = dw.screenGeometry().width();
int screenHeight = dw.screenGeometry().height();
QString customStartWindowBgFileString(UserDataDir+"/startwindowbg10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
QFile customStartWindowBgFile(customStartWindowBgFileString);
if(customStartWindowBgFile.exists()) {
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: top center; background-origin: content; background-repeat: no-repeat;}");
} else {
//if custom bg file could not be found load the big origin file
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg10_mobile.png); background-position: top center; background-origin: content; background-repeat: no-repeat;}");
}
this->showFullScreen();
//TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(true)
//TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(true)
// #ifndef ANDROID_TEST
// JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
// JNIEnv* env;
@@ -128,11 +128,11 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
// currVM->DetachCurrentThread();
// }
// #endif
#else
#else
// Maemo
this->menubar->hide();
centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg10_desktop.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
#endif
this->menubar->hide();
centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg10_desktop.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
#endif
// All mobile GUI's
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: #505050; color: #FDC942; 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: #505050; color: #FDC942; font-size:22px; border-width: 0px;}");
@@ -1186,8 +1186,9 @@ void startWindowImpl::networkMessage(unsigned msgId)
msgText = tr("The player could not be found.");
}
break;
default: showMsgBox = false;
break;
default:
showMsgBox = false;
break;
}
if(showMsgBox) {
+1 -1
View File
@@ -35,7 +35,7 @@
#include <QtGui>
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#include <QtWidgets>
#endif
#ifndef Q_MOC_RUN
#include <third_party/boost/timers.hpp>