diff --git a/pokerth_game.pro b/pokerth_game.pro index 0275dc12..c3a5b0b6 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -248,6 +248,23 @@ unix: !mac{ message("Found libboost_thread") LIBS += -lboost_thread } + + exists( /usr/lib/libboost_filesystem-mt.so ){ + message("Found libboost_filesystem-mt") + LIBS += -lboost_filesystem-mt + } + exists( /usr/lib64/libboost_filesystem-mt.so ){ + message("Found libboost_filesystem-mt") + LIBS += -lboost_filesystem-mt + } + exists( /usr/lib/libboost_filesystem.so ){ + message("Found libboost_filesystem") + LIBS += -lboost_filesystem + } + exists( /usr/lib64/libboost_filesystem.so ){ + message("Found libboost_filesystem") + LIBS += -lboost_filesystem + } LIBPATH += lib LIBS += -lpokerth_lib LIBS += -lcrypto -lSDL_mixer diff --git a/pokerth_server.pro b/pokerth_server.pro index 14448cd7..d626e744 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -127,6 +127,23 @@ unix:!mac{ message("Found libboost_thread") LIBS += -lboost_thread } + + exists( /usr/lib/libboost_filesystem-mt.so ){ + message("Found libboost_filesystem-mt") + LIBS += -lboost_filesystem-mt + } + exists( /usr/lib64/libboost_filesystem-mt.so ){ + message("Found libboost_filesystem-mt") + LIBS += -lboost_filesystem-mt + } + exists( /usr/lib/libboost_filesystem.so ){ + message("Found libboost_filesystem") + LIBS += -lboost_filesystem + } + exists( /usr/lib64/libboost_filesystem.so ){ + message("Found libboost_filesystem") + LIBS += -lboost_filesystem + } LIBPATH += lib LIBS += -lpokerth_lib LIBS += -lcrypto diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index e114e30e..b8d423a4 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -2477,7 +2477,7 @@ void mainWindowImpl::breakButtonClicked() { void mainWindowImpl::paintStartSplash() { - StartSplash *mySplash = new StartSplash(this); + StartSplash *mySplash = new StartSplash(this, myConfig); #ifdef __APPLE__ int offset = 305; diff --git a/src/gui/qt/mainwindow/startsplash/startsplash.cpp b/src/gui/qt/mainwindow/startsplash/startsplash.cpp index 15deceb7..dc77e292 100644 --- a/src/gui/qt/mainwindow/startsplash/startsplash.cpp +++ b/src/gui/qt/mainwindow/startsplash/startsplash.cpp @@ -19,16 +19,19 @@ ***************************************************************************/ #include "startsplash.h" -StartSplash::StartSplash(mainWindowImpl *parent) - : QSplashScreen(parent), myW(parent) +#include "configfile.h" +#include "mainwindowimpl.h" + +StartSplash::StartSplash(mainWindowImpl *parent, ConfigFile *c) + : QSplashScreen(parent), myW(parent), myConfig(c) { - myQtHelper = new QtHelper; + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/c059013l.pfb"); - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/andybold.ttf"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/c059013l.pfb"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/andybold.ttf"); - logo = myQtHelper->getDataPath()+"gfx/gui/misc/logoChip3D.png"; + logo = myAppDataPath+"gfx/gui/misc/logoChip3D.png"; frameNo = 52; diff --git a/src/gui/qt/mainwindow/startsplash/startsplash.h b/src/gui/qt/mainwindow/startsplash/startsplash.h index 05d5f03e..c1660b0e 100644 --- a/src/gui/qt/mainwindow/startsplash/startsplash.h +++ b/src/gui/qt/mainwindow/startsplash/startsplash.h @@ -12,17 +12,16 @@ #ifndef STARTSPLASH_H #define STARTSPLASH_H -#include "mainwindowimpl.h" -#include "qthelper.h" - #include #include +class mainWindowImpl; +class ConfigFile; class StartSplash : public QSplashScreen { Q_OBJECT public: - StartSplash(mainWindowImpl *); + StartSplash(mainWindowImpl *, ConfigFile*); ~StartSplash(); @@ -39,8 +38,9 @@ public slots: private: mainWindowImpl *myW; - QtHelper *myQtHelper; - QPixmap logo; + QString myAppDataPath; + QPixmap logo; + ConfigFile *myConfig; }; diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp index 1a0dd380..705b1115 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.cpp @@ -29,9 +29,9 @@ selectAvatarDialogImpl::selectAvatarDialogImpl(QWidget *parent, ConfigFile *c) setupUi(this); - myQtHelper = new QtHelper; + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); - pushButton_OpenAvatarFile->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); + pushButton_OpenAvatarFile->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png"))); // listWidget->setViewMode(QListView::IconMode); // listWidget->setIconSize(QSize(50,50)); diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h index f9d2aa27..cbb4d95a 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h @@ -25,8 +25,6 @@ #include #include -#include "qthelper.h" - class ConfigFile; class selectAvatarDialogImpl; @@ -53,11 +51,11 @@ public slots: private: ConfigFile* myConfig; - QtHelper *myQtHelper; bool settingsCorrect; QString externalAvatar; QString avatarDir; + QString myAppDataPath; }; diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp index dfed74fe..dd374d16 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.cpp @@ -30,11 +30,11 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva { setupUi(this); - - QtHelper *myQtHelper = new QtHelper; - pushButton_openFlipsidePicture->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); - pushButton_openLogDir->setIcon(QIcon(QPixmap(myQtHelper->getDataPath()+"gfx/gui/misc/fileopen16.png"))); + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); + + pushButton_openFlipsidePicture->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png"))); + pushButton_openLogDir->setIcon(QIcon(QPixmap(myAppDataPath+"gfx/gui/misc/fileopen16.png"))); if (myConfig->readConfigInt("CLA_NoWriteAccess")) { groupBox_logOnOff->setDisabled(TRUE); } diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index d63ba74d..876b0d68 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -23,8 +23,6 @@ #include "ui_settingsdialog.h" #include "selectavatardialogimpl.h" -#include "qthelper.h" - #include #include @@ -68,6 +66,7 @@ private: ConfigFile* myConfig; selectAvatarDialogImpl* mySelectAvatarDialogImpl; + QString myAppDataPath; }; diff --git a/src/gui/qt/sound/sdlplayer.cpp b/src/gui/qt/sound/sdlplayer.cpp index b525f8ea..3e7949a4 100644 --- a/src/gui/qt/sound/sdlplayer.cpp +++ b/src/gui/qt/sound/sdlplayer.cpp @@ -25,7 +25,7 @@ SDLPlayer::SDLPlayer(ConfigFile *c) SDL_Init(SDL_INIT_AUDIO); initAudio(); - myQtHelper = new QtHelper; + myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); } @@ -56,7 +56,7 @@ void SDLPlayer::playSound(string audioString, int playerID) { if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { - QFile myFile(myQtHelper->getDataPath() + "sounds/default/" + QString::fromStdString(audioString)+".wav"); + QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav"); if(myFile.open(QIODevice::ReadOnly)) { diff --git a/src/gui/qt/sound/sdlplayer.h b/src/gui/qt/sound/sdlplayer.h index 12105613..235d558d 100644 --- a/src/gui/qt/sound/sdlplayer.h +++ b/src/gui/qt/sound/sdlplayer.h @@ -15,7 +15,6 @@ #define SDLPLAYER_H #include "configfile.h" -#include "qthelper.h" #if (defined _WIN32) || (defined __APPLE__) #include @@ -53,7 +52,7 @@ private: bool audioEnabled; ConfigFile *myConfig; - QtHelper *myQtHelper; + QString myAppDataPath; }; diff --git a/src/pokerth.cpp b/src/pokerth.cpp index e4581c6f..30b15736 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -36,8 +36,6 @@ #include #include -#include "qthelper.h" - #include #include @@ -68,7 +66,6 @@ int main( int argc, char **argv ) { //create defaultconfig ConfigFile *myConfig = new ConfigFile(argc, argv); - QtHelper *myQtHelper = new QtHelper; //ENABLE_LEAK_CHECK(); //_CrtSetBreakAlloc(49937); @@ -81,13 +78,14 @@ int main( int argc, char **argv ) // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets a.setStyle(new QPlastiqueStyle); + QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str()); //set QApplication default font #ifdef _WIN32 QString font1String("font-family: \"Arial\";"); #else - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/n019003l.pfb"); - QFontDatabase::addApplicationFont (myQtHelper->getDataPath() +"fonts/VeraBd.ttf"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/n019003l.pfb"); + QFontDatabase::addApplicationFont (myAppDataPath +"fonts/VeraBd.ttf"); QString font1String("font-family: \"Nimbus Sans L\";"); #endif @@ -95,11 +93,11 @@ int main( int argc, char **argv ) //Set translations QTranslator qtTranslator; - qtTranslator.load(QString(myQtHelper->getDataPath() +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); + qtTranslator.load(QString(myAppDataPath +"translations/qt_") + QString::fromStdString(myConfig->readConfigString("Language"))); a.installTranslator(&qtTranslator); QTranslator translator; - translator.load(QString(myQtHelper->getDataPath() +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language"))); + translator.load(QString(myAppDataPath +"translations/pokerth_") + QString::fromStdString(myConfig->readConfigString("Language"))); a.installTranslator(&translator);