Dedicated server no longer depends on qt. Added code for utf-8 conversion on windows and linux (without qt). Some small issues remain (like the data-dir and charset for the server).
This commit is contained in:
1 parent
c17be5af25
commit
b4a1ce8bd5
18 files changed
+465
-60
No files matched your search
@@ -11,6 +11,7 @@
|
||||
//
|
||||
#include "qthelper.h"
|
||||
|
||||
|
||||
QtHelper::QtHelper()
|
||||
{
|
||||
}
|
||||
@@ -32,7 +33,7 @@ std::string QtHelper::getDefaultLanguage() { return QLocale::system().name().toS
|
||||
|
||||
QString QtHelper::getDataPath()
|
||||
{
|
||||
QString path = QCoreApplication::instance()->applicationDirPath();
|
||||
QString path(QCoreApplication::instance()->applicationDirPath());
|
||||
|
||||
#ifdef _WIN32
|
||||
path += "/data/";
|
||||
@@ -57,9 +58,9 @@ QString QtHelper::getDataPath()
|
||||
return QDir::cleanPath(path) + "/";
|
||||
}
|
||||
|
||||
std::string QtHelper::getDataPathStdString(const std::string &appPath)
|
||||
std::string QtHelper::getDataPathStdString(const char * /*argv0*/)
|
||||
{
|
||||
QString path(appPath.c_str());
|
||||
QString path(QCoreApplication::instance()->applicationDirPath());
|
||||
|
||||
#ifdef _WIN32
|
||||
path += "/data/";
|
||||
|
||||
@@ -12,23 +12,27 @@
|
||||
#ifndef QTHELPER_H
|
||||
#define QTHELPER_H
|
||||
|
||||
#ifdef POKERTH_DEDICATED_SERVER
|
||||
#error This file is not for the server.
|
||||
#endif
|
||||
|
||||
#include <QtCore>
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
*/
|
||||
class QtHelper : public QObject{
|
||||
Q_OBJECT
|
||||
class QtHelper
|
||||
{
|
||||
|
||||
public:
|
||||
QtHelper();
|
||||
QtHelper();
|
||||
|
||||
~QtHelper();
|
||||
~QtHelper();
|
||||
|
||||
std::string stringToUtf8(const std::string &);
|
||||
std::string getDefaultLanguage();
|
||||
|
||||
QString getDataPath();
|
||||
std::string getDataPathStdString(const std::string &appPath);
|
||||
std::string stringToUtf8(const std::string &);
|
||||
std::string getDefaultLanguage();
|
||||
|
||||
QString getDataPath();
|
||||
std::string getDataPathStdString(const char *argv0);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user