diff --git a/pokerth_game.pro b/pokerth_game.pro index ed23cd98..71c503cc 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -301,7 +301,7 @@ unix: !mac{ #### INSTALL #### - targets.files += pokerth + targets.files = pokerth targets.path = /usr/bin/ data.path = /usr/share/pokerth/data diff --git a/pokerth_server.pro b/pokerth_server.pro index 91c785e3..5c6c5b2e 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -10,7 +10,6 @@ UI_DIR = uics TARGET = bin/pokerth_server MOC_DIR = mocs OBJECTS_DIR = obj -# QMAKE_CXXFLAGS_DEBUG += -g DEFINES += POKERTH_DEDICATED_SERVER INSTALLS += TARGET @@ -135,7 +134,7 @@ win32 { !win32 { DEPENDPATH += src/net/linux/ src/core/linux SOURCES += src/core/linux/daemon.c - SOURCES += src/core/win32/convhelper.cpp + SOURCES += src/core/linux/convhelper.cpp } unix : !mac { diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 1d17689b..24194db6 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -58,7 +58,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) logOnOffDefault = "1"; claNoWriteAccess = "0"; - if(!noWriteAccess) { // Pfad und Dateinamen setzen #ifdef _WIN32 diff --git a/src/gui/qt/qttools/qthelper/qthelper.cpp b/src/gui/qt/qttools/qthelper/qthelper.cpp index 63b76e72..b0c0f9f4 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.cpp +++ b/src/gui/qt/qttools/qthelper/qthelper.cpp @@ -10,7 +10,7 @@ // // #include "qthelper.h" - +#include QtHelper::QtHelper() { @@ -31,37 +31,10 @@ std::string QtHelper::stringToUtf8(const std::string &myString) { std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toStdString(); } -QString QtHelper::getDataPath() -{ - QString path(QCoreApplication::instance()->applicationDirPath()); - -#ifdef _WIN32 - path += "/data/"; -#else - #ifdef __APPLE__ - if (QRegExp("Contents/MacOS/?$").indexIn(path) != -1) { - // pointing into an macosx application bundle - path += "/../Resources/data/"; - } else { path += "/data/"; } - #else //Unix - if (QRegExp("pokerth/?$").indexIn(path) != -1) { - // there is an own application directory - path += "/data/"; - } else if (QRegExp("bin/?$").indexIn(path) != -1) { - // we are in a bin directory. e.g. /usr/bin - path += "/../share/pokerth/data/"; - } else { path += "/data/"; } - #endif -#endif - - - return QDir::cleanPath(path) + "/"; -} - std::string QtHelper::getDataPathStdString(const char * /*argv0*/) { QString path(QCoreApplication::instance()->applicationDirPath()); - + #ifdef _WIN32 path += "/data/"; #else @@ -74,13 +47,15 @@ std::string QtHelper::getDataPathStdString(const char * /*argv0*/) if (QRegExp("pokerth/?$").indexIn(path) != -1) { // there is an own application directory path += "/data/"; + } else if (QRegExp("usr/games/bin/?$").indexIn(path) != -1) { + // we are in /usr/games/bin (like gentoo linux does) + path += "/../../share/games/pokerth/data/"; } else if (QRegExp("bin/?$").indexIn(path) != -1) { // we are in a bin directory. e.g. /usr/bin path += "/../share/pokerth/data/"; + } else { path += "/data/"; } #endif #endif - - return (QDir::cleanPath(path) + "/").toUtf8().constData(); } diff --git a/src/gui/qt/qttools/qthelper/qthelper.h b/src/gui/qt/qttools/qthelper/qthelper.h index 05fc2bd6..4e5594ad 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.h +++ b/src/gui/qt/qttools/qthelper/qthelper.h @@ -31,7 +31,6 @@ public: std::string stringToUtf8(const std::string &); std::string getDefaultLanguage(); - QString getDataPath(); std::string getDataPathStdString(const char *argv0); }; diff --git a/src/pokerth.cpp b/src/pokerth.cpp index a8e39ab5..e4769e50 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -70,8 +70,7 @@ class Game; int main( int argc, char **argv ) { - //create defaultconfig - ConfigFile *myConfig = new ConfigFile(argc, argv); + //ENABLE_LEAK_CHECK(); //_CrtSetBreakAlloc(49937); @@ -80,6 +79,9 @@ int main( int argc, char **argv ) /////// can be removed for non-qt-guis //////////// QApplication a( argc, argv ); + //create defaultconfig + ConfigFile *myConfig = new ConfigFile(argc, argv); + // set PlastiqueStyle even for mac-version to prevent artefacts on styled widgets a.setStyle(new QPlastiqueStyle);