mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Make BTTVEmotes fully conform and use QString instead of std::string
This commit is contained in:
parent
93fe7adce7
commit
6906d1dc1c
3 changed files with 10 additions and 10 deletions
|
@ -32,7 +32,7 @@ void BTTVEmotes::loadGlobalEmotes()
|
|||
|
||||
QString urlTemplate = "https:" + root.value("urlTemplate").toString();
|
||||
|
||||
std::vector<std::string> codes;
|
||||
std::vector<QString> 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<uti
|
|||
|
||||
QString linkTemplate = "https:" + rootNode.value("urlTemplate").toString();
|
||||
|
||||
std::vector<std::string> codes;
|
||||
std::vector<QString> codes;
|
||||
for (const QJsonValue &emoteNode : emotesNode) {
|
||||
QJsonObject emoteObject = emoteNode.toObject();
|
||||
|
||||
|
@ -110,10 +110,10 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<uti
|
|||
|
||||
this->channelEmotes.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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ class BTTVEmotes
|
|||
{
|
||||
public:
|
||||
util::EmoteMap globalEmotes;
|
||||
SignalVector<std::string> globalEmoteCodes;
|
||||
SignalVector<QString> globalEmoteCodes;
|
||||
|
||||
util::EmoteMap channelEmotes;
|
||||
std::map<std::string, SignalVector<std::string>> channelEmoteCodes;
|
||||
std::map<QString, SignalVector<QString>> channelEmoteCodes;
|
||||
|
||||
void loadGlobalEmotes();
|
||||
void loadChannelEmotes(const QString &channelName,
|
||||
|
|
|
@ -32,7 +32,7 @@ void CompletionModel::refresh()
|
|||
}
|
||||
|
||||
// Global: BTTV Global Emotes
|
||||
std::vector<std::string> &bttvGlobalEmoteCodes = app->emotes->bttv.globalEmoteCodes;
|
||||
std::vector<QString> &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<std::string> &bttvChannelEmoteCodes =
|
||||
app->emotes->bttv.channelEmoteCodes[this->channelName.toStdString()];
|
||||
std::vector<QString> &bttvChannelEmoteCodes =
|
||||
app->emotes->bttv.channelEmoteCodes[this->channelName];
|
||||
for (const auto &m : bttvChannelEmoteCodes) {
|
||||
this->addString(m, TaggedString::Type::BTTVChannelEmote);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue