From b40ba0cf91603b695f1f2380cbd39966a458f22f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 27 Sep 2009 19:58:24 +0200 Subject: Use Unicode-aware String class instead of std::string --- src/Common/Requests/DisconnectRequest.cpp | 2 +- src/Common/Requests/IdentifyRequest.cpp | 3 +-- src/Common/Requests/IdentifyRequest.h | 4 ++-- src/Common/Requests/SimpleRequest.h | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/Common/Requests') diff --git a/src/Common/Requests/DisconnectRequest.cpp b/src/Common/Requests/DisconnectRequest.cpp index c2b7b71..676c9e1 100644 --- a/src/Common/Requests/DisconnectRequest.cpp +++ b/src/Common/Requests/DisconnectRequest.cpp @@ -32,7 +32,7 @@ void DisconnectRequest::sendRequest() { void DisconnectRequest::handlePacket(boost::shared_ptr packet) { if(packet->getType() == "Error") { - signalFinished(Core::Exception(packet->get("Where"), static_cast(packet->get("ErrorCode")), + signalFinished(Core::Exception(packet->get("Where").extract(), static_cast(packet->get("ErrorCode")), packet->get("SubCode"), packet->get("SubSubCode"))); return; } diff --git a/src/Common/Requests/IdentifyRequest.cpp b/src/Common/Requests/IdentifyRequest.cpp index 98868ef..a9e566a 100644 --- a/src/Common/Requests/IdentifyRequest.cpp +++ b/src/Common/Requests/IdentifyRequest.cpp @@ -27,8 +27,7 @@ void IdentifyRequest::sendRequest() { Common::XmlData packet; packet.setType("Identify"); - if(!hostname.empty()) - packet.set("hostname", hostname); + packet.set("hostname", hostname); sendPacket(packet); } diff --git a/src/Common/Requests/IdentifyRequest.h b/src/Common/Requests/IdentifyRequest.h index 51b24dd..b0e9669 100644 --- a/src/Common/Requests/IdentifyRequest.h +++ b/src/Common/Requests/IdentifyRequest.h @@ -32,13 +32,13 @@ namespace Requests { class MAD_COMMON_EXPORT IdentifyRequest : public Common::Request { private: - std::string hostname; + Core::String hostname; protected: virtual void sendRequest(); public: - IdentifyRequest(Application *application, const std::string &hostname0) : Request(application), hostname(hostname0) {} + IdentifyRequest(Application *application, const Core::String &hostname0) : Request(application), hostname(hostname0) {} }; } diff --git a/src/Common/Requests/SimpleRequest.h b/src/Common/Requests/SimpleRequest.h index 4bff997..ff0c3c1 100644 --- a/src/Common/Requests/SimpleRequest.h +++ b/src/Common/Requests/SimpleRequest.h @@ -24,7 +24,7 @@ #include "../Request.h" -#include +#include namespace Mad { namespace Common { @@ -32,11 +32,11 @@ namespace Requests { class MAD_COMMON_EXPORT SimpleRequest : public Request { protected: - const std::string type; + const Core::String type; virtual void sendRequest(); - SimpleRequest(Application *application, const std::string &type0) : Request(application), type(type0) {} + SimpleRequest(Application *application, const Core::String &type0) : Request(application), type(type0) {} }; } -- cgit v1.2.3