From 09963700ae5566ce5a1906d3a5ca5992bfe94d34 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 7 Jun 2018 12:22:28 +0200 Subject: [PATCH] Clean up BTTVEmotes class --- src/providers/bttv/bttvemotes.cpp | 7 +------ src/providers/bttv/bttvemotes.hpp | 7 ++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/providers/bttv/bttvemotes.cpp b/src/providers/bttv/bttvemotes.cpp index 4ccdda731..86407d175 100644 --- a/src/providers/bttv/bttvemotes.cpp +++ b/src/providers/bttv/bttvemotes.cpp @@ -19,11 +19,6 @@ QString getEmoteLink(QString urlTemplate, const QString &id, const QString &emot } // namespace -util::EmoteMap &BTTVEmotes::getBTTVChannelEmoteFromCaches() -{ - return _bttvChannelEmoteFromCaches; -} - void BTTVEmotes::loadGlobalEmotes() { QString url("https://api.betterttv.net/2/emotes"); @@ -91,7 +86,7 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptrgetBTTVChannelEmoteFromCaches().getOrAdd(id, [&] { + auto emote = this->channelEmoteCache.getOrAdd(id, [&] { util::EmoteData emoteData; QString link = linkTemplate; link.detach(); diff --git a/src/providers/bttv/bttvemotes.hpp b/src/providers/bttv/bttvemotes.hpp index edef6a5e2..72daf4461 100644 --- a/src/providers/bttv/bttvemotes.hpp +++ b/src/providers/bttv/bttvemotes.hpp @@ -19,15 +19,12 @@ public: util::EmoteMap channelEmotes; std::map> channelEmoteCodes; - util::EmoteMap &getBTTVChannelEmoteFromCaches(); - void loadGlobalEmotes(); void loadChannelEmotes(const QString &channelName, std::weak_ptr channelEmoteMap); - util::ConcurrentMap channels; - - util::EmoteMap _bttvChannelEmoteFromCaches; +private: + util::EmoteMap channelEmoteCache; }; } // namespace bttv