From 85e19d0bd63f2629d6042cdec2836f3048263ffa Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 7 Jun 2018 13:24:07 +0200 Subject: [PATCH] Remove more QString usages --- src/providers/twitch/pubsub.cpp | 6 +++--- src/providers/twitch/twitchmessagebuilder.cpp | 4 ++-- src/util/completionmodel.hpp | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/providers/twitch/pubsub.cpp b/src/providers/twitch/pubsub.cpp index a0a4fc96d..a80f00fbd 100644 --- a/src/providers/twitch/pubsub.cpp +++ b/src/providers/twitch/pubsub.cpp @@ -22,7 +22,7 @@ namespace twitch { static const char *pingPayload = "{\"type\":\"PING\"}"; -static std::map sentMessages; +static std::map sentMessages; namespace detail { @@ -68,7 +68,7 @@ bool PubSubClient::listen(rapidjson::Document &message) rj::set(message, "nonce", uuid); std::string payload = rj::stringify(message); - sentMessages[uuid.toStdString()] = payload; + sentMessages[uuid] = payload; this->send(payload.c_str()); @@ -100,7 +100,7 @@ void PubSubClient::unlistenPrefix(const std::string &prefix) rj::set(message, "nonce", CreateUUID()); std::string payload = rj::stringify(message); - sentMessages[uuid.toStdString()] = payload; + sentMessages[uuid] = payload; this->send(payload.c_str()); } diff --git a/src/providers/twitch/twitchmessagebuilder.cpp b/src/providers/twitch/twitchmessagebuilder.cpp index 3a29b71ff..f36095e59 100644 --- a/src/providers/twitch/twitchmessagebuilder.cpp +++ b/src/providers/twitch/twitchmessagebuilder.cpp @@ -509,8 +509,8 @@ void TwitchMessageBuilder::appendTwitchEmote(const Communi::IrcMessage *ircMessa return; } - long int start = std::stol(coords.at(0).toStdString(), nullptr, 10); - long int end = std::stol(coords.at(1).toStdString(), nullptr, 10); + int start = coords.at(0).toInt(); + int end = coords.at(1).toInt(); if (start >= end || start < 0 || end > this->originalMessage.length()) { return; diff --git a/src/util/completionmodel.hpp b/src/util/completionmodel.hpp index 76d22d656..687cbb2ef 100644 --- a/src/util/completionmodel.hpp +++ b/src/util/completionmodel.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace chatterino {