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:
@@ -18,8 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#include "configfile.h"
|
||||
|
||||
#include <qttoolswrapper.h>
|
||||
#include <qttoolsinterface.h>
|
||||
|
||||
#define MODUS 0711
|
||||
|
||||
@@ -28,8 +27,6 @@
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
@@ -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; i<argc; i++) {
|
||||
if(strcmp(argv[i], "--nowriteaccess") == 0) { noWriteAccess = 1; }
|
||||
@@ -145,12 +142,10 @@ ConfigFile::ConfigFile(int argc, char **argv) : noWriteAccess(0)
|
||||
claNoWriteAccess = "1";
|
||||
}
|
||||
|
||||
boost::filesystem::path startPath(argv[0]);
|
||||
|
||||
ostringstream tempIntToString;
|
||||
tempIntToString << configRev;
|
||||
configList.push_back(ConfigInfo("ConfigRevision", CONFIG_TYPE_INT, tempIntToString.str()));
|
||||
configList.push_back(ConfigInfo("AppDataDir", CONFIG_TYPE_STRING, myQtToolsInterface->getDataPathStdString(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 );
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
ConfigState myConfigState;
|
||||
QtToolsInterface *myQtToolsInterface;
|
||||
|
||||
char **myArgv;
|
||||
char *myArgv0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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 <string>
|
||||
|
||||
class ConvHelper
|
||||
{
|
||||
public:
|
||||
|
||||
static std::string NativeToUtf8(const std::string &inStr);
|
||||
static std::string Utf8ToNative(const std::string &inStr);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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 <string>
|
||||
#include <iostream>
|
||||
|
||||
#include <iconv.h>
|
||||
#include <errno.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
string
|
||||
ConvHelper::NativeToUtf8(const std::string &inStr)
|
||||
{
|
||||
string retStr(inStr);
|
||||
size_t insize = inStr.length();
|
||||
char *inbuf = const_cast<char *>(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<char *>(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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <windows.h>
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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 <core/convhelper.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
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/");
|
||||
}
|
||||
@@ -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 <string>
|
||||
|
||||
class NonQtHelper
|
||||
{
|
||||
|
||||
public:
|
||||
NonQtHelper();
|
||||
|
||||
~NonQtHelper();
|
||||
|
||||
std::string stringToUtf8(const std::string &);
|
||||
std::string getDefaultLanguage();
|
||||
|
||||
std::string getDataPathStdString(const char *argv0);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -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 <nonqthelper/nonqthelper.h>
|
||||
|
||||
|
||||
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); }
|
||||
|
||||
@@ -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 <qttoolsinterface.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
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
|
||||
@@ -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
|
||||
|
||||
@@ -19,11 +19,18 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "qttoolswrapper.h"
|
||||
#include <qthelper.h>
|
||||
|
||||
#include <qthelper/qthelper.h>
|
||||
|
||||
|
||||
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); }
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user