diff --git a/pokerth_game.pro b/pokerth_game.pro index fb790d2d..ed23cd98 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -182,6 +182,8 @@ SOURCES += \ src/pokerth.cpp \ src/gui/qt/sound/sdlplayer.cpp \ src/gui/qt/guiwrapper.cpp \ + src/gui/qt/qttools/qttoolswrapper.cpp \ + src/gui/qt/qttools/qthelper/qthelper.cpp \ src/gui/qt/mainwindow/mainwindowimpl.cpp \ src/gui/qt/mainwindow/mycardspixmaplabel.cpp \ src/gui/qt/mainwindow/mysetlabel.cpp \ diff --git a/pokerth_lib.pro b/pokerth_lib.pro index adf778a4..4d0b1fc5 100644 --- a/pokerth_lib.pro +++ b/pokerth_lib.pro @@ -9,7 +9,6 @@ INCLUDEPATH += . \ src/gui \ src/gui/qt \ src/gui/qt/qttools \ - src/gui/qt/qttools/qthelper \ src/net \ src/engine/local_engine \ src/engine/network_engine \ @@ -95,8 +94,6 @@ HEADERS += \ src/engine/network_engine/clientplayer.h \ src/engine/network_engine/clientbero.h \ src/gui/qttoolsinterface.h \ - src/gui/qt/qttools/qttoolswrapper.h \ - src/gui/qt/qttools/qthelper/qthelper.h \ src/gui/generic/serverguiwrapper.h SOURCES += \ @@ -163,10 +160,8 @@ SOURCES += \ src/net/common/receiverhelper.cpp \ src/net/common/irccallback.cpp \ src/net/common/ircthread.cpp \ - src/gui/qttoolsinterface.cpp \ - src/gui/qt/qttools/qttoolswrapper.cpp \ - src/gui/qt/qttools/qthelper/qthelper.cpp \ - src/gui/generic/serverguiwrapper.cpp + src/gui/generic/serverguiwrapper.cpp \ + src/gui/qttoolsinterface.cpp win32{ DEPENDPATH += src/net/win32/ src/core/win32 diff --git a/pokerth_server.pro b/pokerth_server.pro index 290bbe6a..91c785e3 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -3,6 +3,16 @@ TEMPLATE = app CODECFORSRC = UTF-8 +#CONFIG += thread console embed_manifest_exe warn_on release +CONFIG += thread console embed_manifest_exe warn_on debug + +UI_DIR = uics +TARGET = bin/pokerth_server +MOC_DIR = mocs +OBJECTS_DIR = obj +# QMAKE_CXXFLAGS_DEBUG += -g +DEFINES += POKERTH_DEDICATED_SERVER + INSTALLS += TARGET TARGET.files += bin/* TARGET.path = /usr/bin/ @@ -13,7 +23,7 @@ INCLUDEPATH += . \ src/gui \ src/gui/qt \ src/gui/qt/qttools \ - src/gui/qt/qttools/qthelper \ + src/gui/qt/qttools/nonqthelper \ src/net \ src/engine/local_engine \ src/engine/network_engine \ @@ -66,6 +76,8 @@ HEADERS += \ src/net/socket_startup.h \ src/core/tinyxml/tinystr.h \ src/core/tinyxml/tinyxml.h \ + src/core/pokerthexception.h \ + src/core/convhelper.h \ src/engine/local_engine/cardsvalue.h \ src/engine/local_engine/localboard.h \ src/engine/local_engine/localenginefactory.h \ @@ -84,18 +96,21 @@ HEADERS += \ src/engine/network_engine/clientplayer.h \ src/engine/network_engine/clientbero.h \ src/gui/qttoolsinterface.h \ - src/gui/qt/qttools/qttoolswrapper.h \ - src/gui/qt/qttools/qthelper/qthelper.h \ - src/gui/generic/serverguiwrapper.h \ - src/core/pokerthexception.h \ - src/engine/local_engine/localexception.h + src/gui/qt/qttools/nonqttoolswrapper.h \ + src/gui/qt/qttools/nonqthelper/nonqthelper.h \ + src/gui/generic/serverguiwrapper.h SOURCES += \ - src/pokerth_server.cpp + src/pokerth_server.cpp \ + src/gui/qt/qttools/nonqttoolswrapper.cpp \ + src/gui/qt/qttools/nonqthelper/nonqthelper.cpp win32 { DEPENDPATH += src/net/win32/ src/core/win32 INCLUDEPATH += ../boost/ ../OpenSSL/include + + SOURCES += src/core/win32/convhelper.cpp + LIBPATH += ../boost/stage/lib ../OpenSSL/lib LIBPATH += Release/lib @@ -120,6 +135,7 @@ win32 { !win32 { DEPENDPATH += src/net/linux/ src/core/linux SOURCES += src/core/linux/daemon.c + SOURCES += src/core/win32/convhelper.cpp } unix : !mac { @@ -164,12 +180,3 @@ unix : !mac { ## My release static libs #LIBS += -lcrypto } - -#CONFIG += qt thread console embed_manifest_exe warn_on release -CONFIG += qt thread console embed_manifest_exe warn_on debug -UI_DIR = uics -TARGET = bin/pokerth_server -MOC_DIR = mocs -OBJECTS_DIR = obj -QT -= gui -# QMAKE_CXXFLAGS_DEBUG += -g diff --git a/src/config/configfile.cpp b/src/config/configfile.cpp index 7e2f9b0e..1d17689b 100644 --- a/src/config/configfile.cpp +++ b/src/config/configfile.cpp @@ -18,8 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "configfile.h" - -#include +#include #define MODUS 0711 @@ -28,8 +27,6 @@ #include #endif -#include - #include #include #include @@ -40,16 +37,16 @@ using namespace std; -class QtToolsWrapper; +QtToolsInterface *CreateQtToolsWrapper(); ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) { - myArgv = argv; + myArgv0 = argv[0]; int i; - myQtToolsInterface = new QtToolsWrapper; + myQtToolsInterface = CreateQtToolsWrapper(); for (i=1; igetDataPathStdString(startPath.remove_leaf().directory_string()))); + configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, myQtToolsInterface->getDataPathStdString(argv[0]))); configList.push_back(ConfigInfo("Language", CONFIG_TYPE_INT, myQtToolsInterface->getDefaultLanguage())); configList.push_back(ConfigInfo("ShowLeftToolBox", CONFIG_TYPE_INT, "1")); configList.push_back(ConfigInfo("ShowRightToolBox", CONFIG_TYPE_INT, "1")); @@ -266,7 +261,7 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0) if (tmpStr) tempAppDataPath = tmpStr; } - if (tempRevision < configRev || tempAppDataPath != myQtToolsInterface->getDataPathStdString(startPath.remove_leaf().directory_string()) ) { /*löschen()*/ + if (tempRevision < configRev || tempAppDataPath != myQtToolsInterface->getDataPathStdString(argv[0]) ) { /*löschen()*/ myConfigState = OLD; updateConfig(myConfigState) ; } @@ -381,7 +376,6 @@ void ConfigFile::writeBuffer() const { void ConfigFile::updateConfig(ConfigState myConfigState) { boost::recursive_mutex::scoped_lock lock(m_configMutex); - boost::filesystem::path startPath(myArgv[0]); size_t i; @@ -453,7 +447,7 @@ void ConfigFile::updateConfig(ConfigState myConfigState) { TiXmlElement * confElement1 = new TiXmlElement( "AppDataDir" ); config->LinkEndChild( confElement1 ); - confElement1->SetAttribute("value", myQtToolsInterface->getDataPathStdString(startPath.remove_leaf().directory_string())); + confElement1->SetAttribute("value", myQtToolsInterface->getDataPathStdString(myArgv0)); TiXmlHandle oldDocHandle( &oldDoc ); diff --git a/src/config/configfile.h b/src/config/configfile.h index 81a304ac..83380029 100644 --- a/src/config/configfile.h +++ b/src/config/configfile.h @@ -80,7 +80,7 @@ private: ConfigState myConfigState; QtToolsInterface *myQtToolsInterface; - char **myArgv; + char *myArgv0; }; #endif diff --git a/src/core/convhelper.h b/src/core/convhelper.h new file mode 100644 index 00000000..8f94d841 --- /dev/null +++ b/src/core/convhelper.h @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +/* Helper class for character conversion functions. */ + +#ifndef _CRYPTHELPER_H_ +#define _CRYPTHELPER_H_ + +#include + +class ConvHelper +{ +public: + + static std::string NativeToUtf8(const std::string &inStr); + static std::string Utf8ToNative(const std::string &inStr); +}; + +#endif diff --git a/src/core/linux/convhelper.cpp b/src/core/linux/convhelper.cpp new file mode 100644 index 00000000..7a4fba6e --- /dev/null +++ b/src/core/linux/convhelper.cpp @@ -0,0 +1,95 @@ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "convhelper.h" + +#ifdef _WIN32 +#error This file is not for Windows. +#endif + +#include +#include + +#include +#include + +using namespace std; + +string +ConvHelper::NativeToUtf8(const std::string &inStr) +{ + string retStr(inStr); + size_t insize = inStr.length(); + char *inbuf = const_cast(inStr.data()); + + const size_t c_outsize = insize * 6; // max size of utf-8 char is 6 per input char + size_t outsize = c_outsize; + char *c_outbuf = new char[outsize]; + char *outbuf = c_outbuf; + + //nl_langinfo(CODESET) + iconv_t conversion = iconv_open("UTF-8", "ISO-8859-1"); + + if (conversion == (iconv_t)(-1)) + cout << "iconv_open() failed: " << strerror(errno) << endl; + else + { + size_t retval = iconv(conversion, &inbuf, &insize, &outbuf, &outsize); + + if (retval == -1) + cout << "iconv() failed: " << strerror(errno) << endl; + retStr = string(c_outbuf, c_outsize - outsize); + } + delete[] c_outbuf; + + iconv_close(conversion); + return retStr; +} + +string +ConvHelper::Utf8ToNative(const std::string &inStr) +{ + string retStr(inStr); + size_t insize = inStr.length(); + char *inbuf = const_cast(inStr.data()); + + const size_t c_outsize = insize; + size_t outsize = c_outsize; + char *c_outbuf = new char[outsize]; + char *outbuf = c_outbuf; + + iconv_t conversion = iconv_open("ISO-8859-1", "UTF-8"); + + if (conversion == (iconv_t)(-1)) + cout << "iconv_open() failed: " << strerror(errno) << endl; + else + { + size_t retval = iconv(conversion, &inbuf, &insize, &outbuf, &outsize); + + if (retval == -1) + cout << "iconv() failed: " << strerror(errno) << endl; + retStr = string(c_outbuf, c_outsize - outsize); + } + delete[] c_outbuf; + + iconv_close(conversion); + return retStr; +} + + diff --git a/src/core/win32/convhelper.cpp b/src/core/win32/convhelper.cpp new file mode 100644 index 00000000..76d9e413 --- /dev/null +++ b/src/core/win32/convhelper.cpp @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "convhelper.h" + +#ifndef _WIN32 +#error This file is Windows only. +#endif + +#include + +using namespace std; + +static string +Convert(const std::string &inStr, int fromCP, int toCP) +{ + // convert str from current Windows source to target charset + string retStr(inStr); + + if (!inStr.empty()) + { + int len = (int)inStr.length() + 1; + int reqLen = ::MultiByteToWideChar(fromCP, 0, inStr.c_str(), len, NULL, 0); + + if (reqLen) + { + wchar_t *wstr = new wchar_t[reqLen]; + wstr[0] = L'\0'; + if (::MultiByteToWideChar(fromCP, 0, inStr.c_str(), len, wstr, reqLen) == (int)reqLen) + { + len = reqLen; + reqLen = ::WideCharToMultiByte(toCP, 0, wstr, len, NULL, 0, NULL, NULL); + + if (reqLen) + { + char *str = new char[reqLen]; + if (::WideCharToMultiByte(toCP, 0, wstr, len, str, reqLen, NULL, NULL) == (int)reqLen) + retStr = str; + delete[] str; + } + } + + delete[] wstr; + } + } + return retStr; +} + +string +ConvHelper::NativeToUtf8(const std::string &inStr) +{ + return Convert(inStr, CP_ACP, CP_UTF8); +} + +string +ConvHelper::Utf8ToNative(const std::string &inStr) +{ + return Convert(inStr, CP_UTF8, CP_ACP); +} + diff --git a/src/gui/qt/qttools/nonqthelper/nonqthelper.cpp b/src/gui/qt/qttools/nonqthelper/nonqthelper.cpp new file mode 100644 index 00000000..238236e3 --- /dev/null +++ b/src/gui/qt/qttools/nonqthelper/nonqthelper.cpp @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "nonqthelper.h" + +#include +#include + +NonQtHelper::NonQtHelper() +{ +} + + +NonQtHelper::~NonQtHelper() +{ +} + +std::string +NonQtHelper::stringToUtf8(const std::string &myString) +{ + return ConvHelper::NativeToUtf8(myString); +} + +std::string +NonQtHelper::getDefaultLanguage() +{ + return "en"; +} + +std::string +NonQtHelper::getDataPathStdString(const char *argv0) +{ + boost::filesystem::path startPath(argv0); + return stringToUtf8(startPath.remove_leaf().directory_string() + "data/"); +} diff --git a/src/gui/qt/qttools/nonqthelper/nonqthelper.h b/src/gui/qt/qttools/nonqthelper/nonqthelper.h new file mode 100644 index 00000000..7cbfdd36 --- /dev/null +++ b/src/gui/qt/qttools/nonqthelper/nonqthelper.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2007 by Lothar May * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef NONQTHELPER_H +#define NONQTHELPER_H + +#ifndef POKERTH_DEDICATED_SERVER +#error This file is only for the server. +#endif + +#include + +class NonQtHelper +{ + +public: + NonQtHelper(); + + ~NonQtHelper(); + + std::string stringToUtf8(const std::string &); + std::string getDefaultLanguage(); + + std::string getDataPathStdString(const char *argv0); +}; + + +#endif diff --git a/src/gui/qt/qttools/nonqttoolswrapper.cpp b/src/gui/qt/qttools/nonqttoolswrapper.cpp new file mode 100644 index 00000000..97803bd5 --- /dev/null +++ b/src/gui/qt/qttools/nonqttoolswrapper.cpp @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "nonqttoolswrapper.h" + +#include + + +using namespace std; + + +QtToolsInterface *CreateQtToolsWrapper() +{ + return new NonQtToolsWrapper; +} + +NonQtToolsWrapper::NonQtToolsWrapper() : myQtHelper(0) +{ + + myQtHelper = new NonQtHelper(); +} + + +NonQtToolsWrapper::~NonQtToolsWrapper() +{ + delete myQtHelper; + myQtHelper = 0; +} + +std::string NonQtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); } +std::string NonQtToolsWrapper::getDefaultLanguage() { return myQtHelper->getDefaultLanguage(); } +std::string NonQtToolsWrapper::getDataPathStdString(const char * argv0) { return myQtHelper->getDataPathStdString(argv0); } + diff --git a/src/gui/qt/qttools/nonqttoolswrapper.h b/src/gui/qt/qttools/nonqttoolswrapper.h new file mode 100644 index 00000000..8e099aa6 --- /dev/null +++ b/src/gui/qt/qttools/nonqttoolswrapper.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2006 by FThauer FHammer * + * f.thauer@web.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef NONQTTOOLSWRAPPER_H +#define NONQTTOOLSWRAPPER_H + +#include + +#include + +class NonQtHelper; + +class NonQtToolsWrapper : public QtToolsInterface +{ +public: + NonQtToolsWrapper(); + ~NonQtToolsWrapper(); + + std::string stringToUtf8(const std::string &myString); + std::string getDefaultLanguage(); + std::string getDataPathStdString(const char *argv0); + +private: + + NonQtHelper *myQtHelper; + +}; + +#endif diff --git a/src/gui/qt/qttools/qthelper/qthelper.cpp b/src/gui/qt/qttools/qthelper/qthelper.cpp index 7b8a6bc4..63b76e72 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.cpp +++ b/src/gui/qt/qttools/qthelper/qthelper.cpp @@ -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/"; diff --git a/src/gui/qt/qttools/qthelper/qthelper.h b/src/gui/qt/qttools/qthelper/qthelper.h index b19f4892..05fc2bd6 100644 --- a/src/gui/qt/qttools/qthelper/qthelper.h +++ b/src/gui/qt/qttools/qthelper/qthelper.h @@ -12,23 +12,27 @@ #ifndef QTHELPER_H #define QTHELPER_H +#ifdef POKERTH_DEDICATED_SERVER +#error This file is not for the server. +#endif + #include /** @author FThauer FHammer */ -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 diff --git a/src/gui/qt/qttools/qttoolswrapper.cpp b/src/gui/qt/qttools/qttoolswrapper.cpp index 1ae49335..6f383b80 100644 --- a/src/gui/qt/qttools/qttoolswrapper.cpp +++ b/src/gui/qt/qttools/qttoolswrapper.cpp @@ -19,11 +19,18 @@ ***************************************************************************/ #include "qttoolswrapper.h" -#include + +#include + using namespace std; +QtToolsInterface *CreateQtToolsWrapper() +{ + return new QtToolsWrapper; +} + QtToolsWrapper::QtToolsWrapper() : myQtHelper(0) { @@ -39,5 +46,5 @@ QtToolsWrapper::~QtToolsWrapper() std::string QtToolsWrapper::stringToUtf8(const std::string &myString) { return myQtHelper->stringToUtf8(myString); } std::string QtToolsWrapper::getDefaultLanguage() { return myQtHelper->getDefaultLanguage(); } -std::string QtToolsWrapper::getDataPathStdString(const std::string &appPath) { return myQtHelper->getDataPathStdString(appPath); } +std::string QtToolsWrapper::getDataPathStdString(const char * argv0) { return myQtHelper->getDataPathStdString(argv0); } diff --git a/src/gui/qt/qttools/qttoolswrapper.h b/src/gui/qt/qttools/qttoolswrapper.h index f5536757..e05f18fb 100644 --- a/src/gui/qt/qttools/qttoolswrapper.h +++ b/src/gui/qt/qttools/qttoolswrapper.h @@ -35,7 +35,7 @@ public: std::string stringToUtf8(const std::string &myString); std::string getDefaultLanguage(); - std::string getDataPathStdString(const std::string &appPath); + std::string getDataPathStdString(const char *argv0); private: diff --git a/src/gui/qttoolsinterface.h b/src/gui/qttoolsinterface.h index bcf86e5e..82adc4f1 100644 --- a/src/gui/qttoolsinterface.h +++ b/src/gui/qttoolsinterface.h @@ -29,7 +29,7 @@ public: //qthelper.cpp virtual std::string stringToUtf8(const std::string &) =0; virtual std::string getDefaultLanguage() =0; - virtual std::string getDataPathStdString(const std::string &) =0; + virtual std::string getDataPathStdString(const char *argv0) =0; }; diff --git a/src/net/common/ircthread.cpp b/src/net/common/ircthread.cpp index 21cfcd32..b2e522f0 100644 --- a/src/net/common/ircthread.cpp +++ b/src/net/common/ircthread.cpp @@ -88,7 +88,7 @@ void irc_handle_server_error(irc_session_t *session, unsigned irc_error_code) } void -irc_event_connect(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/) +irc_event_connect(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char ** /*params*/, unsigned /*count*/) { IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -97,7 +97,7 @@ irc_event_connect(irc_session_t *session, const char */*irc_event*/, const char } void -irc_event_join(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/) +irc_event_join(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char ** /*params*/, unsigned /*count*/) { // someone joined the channel. IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -109,7 +109,7 @@ irc_event_join(irc_session_t *session, const char */*irc_event*/, const char *or } void -irc_event_nick(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count) +irc_event_nick(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char **params, unsigned count) { // someone changed his/her nick IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -123,7 +123,7 @@ irc_event_nick(irc_session_t *session, const char */*irc_event*/, const char *or } void -irc_event_kick(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count) +irc_event_kick(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char **params, unsigned count) { // someone got kicked IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -141,7 +141,7 @@ irc_event_kick(irc_session_t *session, const char */*irc_event*/, const char *or } void -irc_event_leave(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **/*params*/, unsigned /*count*/) +irc_event_leave(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char ** /*params*/, unsigned /*count*/) { // someone left the channel. IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -150,7 +150,7 @@ irc_event_leave(irc_session_t *session, const char */*irc_event*/, const char *o } void -irc_event_channel(irc_session_t *session, const char */*irc_event*/, const char *origin, const char **params, unsigned count) +irc_event_channel(irc_session_t *session, const char * /*irc_event*/, const char *origin, const char **params, unsigned count) { IrcContext *context = (IrcContext *) irc_get_ctx(session); @@ -163,7 +163,7 @@ irc_event_channel(irc_session_t *session, const char */*irc_event*/, const char } void -irc_event_numeric(irc_session_t * session, unsigned irc_event, const char */*origin*/, const char **params, unsigned count) +irc_event_numeric(irc_session_t * session, unsigned irc_event, const char * /*origin*/, const char **params, unsigned count) { switch (irc_event) {