More utf8 related fixes (some issues remain).
This commit is contained in:
@@ -36,6 +36,7 @@ class ClientSenderCallback;
|
||||
class Game;
|
||||
class NetPacket;
|
||||
class AvatarManager;
|
||||
class QtToolsInterface;
|
||||
|
||||
class ClientThread : public Thread
|
||||
{
|
||||
@@ -168,6 +169,7 @@ private:
|
||||
mutable boost::mutex m_gameInfoMapMutex;
|
||||
|
||||
boost::shared_ptr<Game> m_game;
|
||||
boost::shared_ptr<QtToolsInterface> myQtToolsInterface;
|
||||
|
||||
PlayerInfoMap m_playerInfoMap;
|
||||
mutable boost::mutex m_playerInfoMapMutex;
|
||||
|
||||
@@ -28,9 +28,11 @@
|
||||
#include <core/loghelper.h>
|
||||
#include <clientenginefactory.h>
|
||||
#include <game.h>
|
||||
#include <qttoolsinterface.h>
|
||||
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
#include <cassert>
|
||||
|
||||
using namespace std;
|
||||
@@ -62,6 +64,7 @@ ClientThread::ClientThread(GuiInterface &gui, AvatarManager &avatarManager)
|
||||
m_senderCallback.reset(new ClientSenderCallback(*this));
|
||||
m_sender.reset(new SenderThread(GetSenderCallback()));
|
||||
m_receiver.reset(new ReceiverHelper);
|
||||
myQtToolsInterface.reset(CreateQtToolsWrapper());
|
||||
}
|
||||
|
||||
ClientThread::~ClientThread()
|
||||
@@ -451,7 +454,7 @@ ClientThread::SetPlayerInfo(unsigned id, const PlayerInfo &info)
|
||||
string avatarFile;
|
||||
if (GetAvatarManager().GetAvatarFileName(info.avatar, avatarFile))
|
||||
{
|
||||
playerData->SetAvatarFile(avatarFile);
|
||||
playerData->SetAvatarFile(myQtToolsInterface->stringToUtf8(avatarFile));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -427,7 +427,12 @@ bool Session::getAvatarFile(const MD5Buf &avatarMD5, std::string &fileName)
|
||||
{
|
||||
bool retVal = false;
|
||||
if (myAvatarManager.get())
|
||||
retVal = myAvatarManager->GetAvatarFileName(avatarMD5, fileName);
|
||||
{
|
||||
string tmpFileName;
|
||||
retVal = myAvatarManager->GetAvatarFileName(avatarMD5, tmpFileName);
|
||||
if (retVal)
|
||||
fileName = myQtToolsInterface->stringToUtf8(tmpFileName);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user