fixes linux compilation problem. add /usr/games/bin support for appPath (gentoo)

This commit is contained in:
doitux
2007-10-01 07:17:05 +00:00
parent b4a1ce8bd5
commit e31f74fe01
6 changed files with 12 additions and 38 deletions
+1 -1
View File
@@ -301,7 +301,7 @@ unix: !mac{
#### INSTALL ####
targets.files += pokerth
targets.files = pokerth
targets.path = /usr/bin/
data.path = /usr/share/pokerth/data
+1 -2
View File
@@ -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 {
-1
View File
@@ -58,7 +58,6 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
logOnOffDefault = "1";
claNoWriteAccess = "0";
if(!noWriteAccess) {
// Pfad und Dateinamen setzen
#ifdef _WIN32
+6 -31
View File
@@ -10,7 +10,7 @@
//
//
#include "qthelper.h"
#include <iostream>
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();
}
-1
View File
@@ -31,7 +31,6 @@ public:
std::string stringToUtf8(const std::string &);
std::string getDefaultLanguage();
QString getDataPath();
std::string getDataPathStdString(const char *argv0);
};
+4 -2
View File
@@ -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);