From 6906d1dc1cdda2b388ab9025db674616dba851af Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 7 Jun 2018 13:09:08 +0200 Subject: [PATCH] Make BTTVEmotes fully conform and use QString instead of std::string --- src/providers/bttv/bttvemotes.cpp | 10 +++++----- src/providers/bttv/bttvemotes.hpp | 4 ++-- src/util/completionmodel.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/providers/bttv/bttvemotes.cpp b/src/providers/bttv/bttvemotes.cpp index 86407d175..0ddc1d10f 100644 --- a/src/providers/bttv/bttvemotes.cpp +++ b/src/providers/bttv/bttvemotes.cpp @@ -32,7 +32,7 @@ void BTTVEmotes::loadGlobalEmotes() QString urlTemplate = "https:" + root.value("urlTemplate").toString(); - std::vector codes; + std::vector codes; for (const QJsonValue &emote : emotes) { QString id = emote.toObject().value("id").toString(); QString code = emote.toObject().value("code").toString(); @@ -47,7 +47,7 @@ void BTTVEmotes::loadGlobalEmotes() emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id; this->globalEmotes.insert(code, emoteData); - codes.push_back(code.toStdString()); + codes.push_back(code); } this->globalEmoteCodes = codes; @@ -78,7 +78,7 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr codes; + std::vector codes; for (const QJsonValue &emoteNode : emotesNode) { QJsonObject emoteObject = emoteNode.toObject(); @@ -110,10 +110,10 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptrchannelEmotes.insert(code, emote); map->insert(code, emote); - codes.push_back(code.toStdString()); + codes.push_back(code); } - this->channelEmoteCodes[channelName.toStdString()] = codes; + this->channelEmoteCodes[channelName] = codes; }); } diff --git a/src/providers/bttv/bttvemotes.hpp b/src/providers/bttv/bttvemotes.hpp index 72daf4461..2be042a67 100644 --- a/src/providers/bttv/bttvemotes.hpp +++ b/src/providers/bttv/bttvemotes.hpp @@ -14,10 +14,10 @@ class BTTVEmotes { public: util::EmoteMap globalEmotes; - SignalVector globalEmoteCodes; + SignalVector globalEmoteCodes; util::EmoteMap channelEmotes; - std::map> channelEmoteCodes; + std::map> channelEmoteCodes; void loadGlobalEmotes(); void loadChannelEmotes(const QString &channelName, diff --git a/src/util/completionmodel.cpp b/src/util/completionmodel.cpp index b3c0371ab..0f899446e 100644 --- a/src/util/completionmodel.cpp +++ b/src/util/completionmodel.cpp @@ -32,7 +32,7 @@ void CompletionModel::refresh() } // Global: BTTV Global Emotes - std::vector &bttvGlobalEmoteCodes = app->emotes->bttv.globalEmoteCodes; + std::vector &bttvGlobalEmoteCodes = app->emotes->bttv.globalEmoteCodes; for (const auto &m : bttvGlobalEmoteCodes) { this->addString(m, TaggedString::Type::BTTVGlobalEmote); } @@ -44,8 +44,8 @@ void CompletionModel::refresh() } // Channel-specific: BTTV Channel Emotes - std::vector &bttvChannelEmoteCodes = - app->emotes->bttv.channelEmoteCodes[this->channelName.toStdString()]; + std::vector &bttvChannelEmoteCodes = + app->emotes->bttv.channelEmoteCodes[this->channelName]; for (const auto &m : bttvChannelEmoteCodes) { this->addString(m, TaggedString::Type::BTTVChannelEmote); }