From 6ee1fc303e1e3dfef04692b9518f1a8eda50774a Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 26 Jun 2018 17:16:58 +0200 Subject: [PATCH] removed SplitColumn --- chatterino.pro | 2 - src/providers/twitch/TwitchEmotes.cpp | 2 +- src/singletons/ResourceManager.cpp | 60 +++++++++++++-------------- src/widgets/splits/SplitColumn.cpp | 7 ---- src/widgets/splits/SplitColumn.hpp | 23 ---------- 5 files changed, 31 insertions(+), 63 deletions(-) delete mode 100644 src/widgets/splits/SplitColumn.cpp delete mode 100644 src/widgets/splits/SplitColumn.hpp diff --git a/chatterino.pro b/chatterino.pro index 5c92411d6..a0642876a 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -210,7 +210,6 @@ SOURCES += \ src/widgets/settingspages/SettingsPage.cpp \ src/widgets/settingspages/SpecialChannelsPage.cpp \ src/widgets/splits/Split.cpp \ - src/widgets/splits/SplitColumn.cpp \ src/widgets/splits/SplitContainer.cpp \ src/widgets/splits/SplitHeader.cpp \ src/widgets/splits/SplitInput.cpp \ @@ -380,7 +379,6 @@ HEADERS += \ src/widgets/settingspages/SettingsPage.hpp \ src/widgets/settingspages/SpecialChannelsPage.hpp \ src/widgets/splits/Split.hpp \ - src/widgets/splits/SplitColumn.hpp \ src/widgets/splits/SplitContainer.hpp \ src/widgets/splits/SplitHeader.hpp \ src/widgets/splits/SplitInput.hpp \ diff --git a/src/providers/twitch/TwitchEmotes.cpp b/src/providers/twitch/TwitchEmotes.cpp index 9aa7d95dc..8e3a393e1 100644 --- a/src/providers/twitch/TwitchEmotes.cpp +++ b/src/providers/twitch/TwitchEmotes.cpp @@ -193,7 +193,7 @@ void TwitchEmotes::refresh(const std::shared_ptr &user) emoteData.filled = true; }; - getAuthorized(url, clientID, oauthToken, QThread::currentThread(), loadEmotes); + twitchApiGetAuthorized(url, clientID, oauthToken, QThread::currentThread(), loadEmotes); } void TwitchEmotes::loadSetData(std::shared_ptr emoteSet) diff --git a/src/singletons/ResourceManager.cpp b/src/singletons/ResourceManager.cpp index 92d6673c6..ca1bcaa1b 100644 --- a/src/singletons/ResourceManager.cpp +++ b/src/singletons/ResourceManager.cpp @@ -352,45 +352,45 @@ void ResourceManager::loadChannelData(const QString &roomID, bool bypassCache) QString cheermoteURL = "https://api.twitch.tv/kraken/bits/actions?channel_id=" + roomID; - get2(cheermoteURL, QThread::currentThread(), true, - [this, roomID](const rapidjson::Document &d) { - ResourceManager::Channel &ch = this->channels[roomID]; + twitchApiGet2( + cheermoteURL, QThread::currentThread(), true, [this, roomID](const rapidjson::Document &d) { + ResourceManager::Channel &ch = this->channels[roomID]; - ParseCheermoteSets(ch.jsonCheermoteSets, d); + ParseCheermoteSets(ch.jsonCheermoteSets, d); - for (auto &set : ch.jsonCheermoteSets) { - CheermoteSet cheermoteSet; - cheermoteSet.regex = - QRegularExpression("^" + set.prefix.toLower() + "([1-9][0-9]*)$"); + for (auto &set : ch.jsonCheermoteSets) { + CheermoteSet cheermoteSet; + cheermoteSet.regex = + QRegularExpression("^" + set.prefix.toLower() + "([1-9][0-9]*)$"); - for (auto &tier : set.tiers) { - Cheermote cheermote; + for (auto &tier : set.tiers) { + Cheermote cheermote; - cheermote.color = QColor(tier.color); - cheermote.minBits = tier.minBits; + cheermote.color = QColor(tier.color); + cheermote.minBits = tier.minBits; - // TODO(pajlada): We currently hardcode dark here :| - // We will continue to do so for now since we haven't had to - // solve that anywhere else - cheermote.emoteDataAnimated.image1x = tier.images["dark"]["animated"]["1"]; - cheermote.emoteDataAnimated.image2x = tier.images["dark"]["animated"]["2"]; - cheermote.emoteDataAnimated.image3x = tier.images["dark"]["animated"]["4"]; + // TODO(pajlada): We currently hardcode dark here :| + // We will continue to do so for now since we haven't had to + // solve that anywhere else + cheermote.emoteDataAnimated.image1x = tier.images["dark"]["animated"]["1"]; + cheermote.emoteDataAnimated.image2x = tier.images["dark"]["animated"]["2"]; + cheermote.emoteDataAnimated.image3x = tier.images["dark"]["animated"]["4"]; - cheermote.emoteDataStatic.image1x = tier.images["dark"]["static"]["1"]; - cheermote.emoteDataStatic.image2x = tier.images["dark"]["static"]["2"]; - cheermote.emoteDataStatic.image3x = tier.images["dark"]["static"]["4"]; + cheermote.emoteDataStatic.image1x = tier.images["dark"]["static"]["1"]; + cheermote.emoteDataStatic.image2x = tier.images["dark"]["static"]["2"]; + cheermote.emoteDataStatic.image3x = tier.images["dark"]["static"]["4"]; - cheermoteSet.cheermotes.emplace_back(cheermote); - } + cheermoteSet.cheermotes.emplace_back(cheermote); + } - std::sort(cheermoteSet.cheermotes.begin(), cheermoteSet.cheermotes.end(), - [](const auto &lhs, const auto &rhs) { - return lhs.minBits < rhs.minBits; // - }); + std::sort(cheermoteSet.cheermotes.begin(), cheermoteSet.cheermotes.end(), + [](const auto &lhs, const auto &rhs) { + return lhs.minBits < rhs.minBits; // + }); - ch.cheermoteSets.emplace_back(cheermoteSet); - } - }); + ch.cheermoteSets.emplace_back(cheermoteSet); + } + }); } void ResourceManager::loadDynamicTwitchBadges() diff --git a/src/widgets/splits/SplitColumn.cpp b/src/widgets/splits/SplitColumn.cpp deleted file mode 100644 index 45cf879e4..000000000 --- a/src/widgets/splits/SplitColumn.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "SplitColumn.hpp" - -namespace chatterino { -namespace helper { - -} // namespace helper -} // namespace chatterino diff --git a/src/widgets/splits/SplitColumn.hpp b/src/widgets/splits/SplitColumn.hpp deleted file mode 100644 index 8ab6a45f1..000000000 --- a/src/widgets/splits/SplitColumn.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include "widgets/splits/Split.hpp" - -#include - -namespace chatterino { - -class SplitColumn -{ -public: - SplitColumn() = default; - - void insert(Split *split, int index = -1); - void remove(int index); - double getFlex(); - void setFlex(double flex); - -private: - std::vector items; -}; - -} // namespace chatterino