From 11442bba203f1b7d33ce872da1bded934e39ce66 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Mon, 16 Dec 2019 08:55:38 +0100 Subject: [PATCH] move titleRefreshPeriod out of the TwitchChannel class this fixes a "use of uninitialized variable" error --- src/providers/twitch/TwitchChannel.cpp | 5 +++-- src/providers/twitch/TwitchChannel.hpp | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 23f6a6055..051a72289 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -31,6 +31,7 @@ namespace chatterino { namespace { + constexpr int TITLE_REFRESH_PERIOD = 10; constexpr char MAGIC_MESSAGE_SUFFIX[] = u8" \U000E0000"; // parseRecentMessages takes a json object and returns a vector of @@ -89,7 +90,7 @@ TwitchChannel::TwitchChannel(const QString &name, , bttvEmotes_(std::make_shared()) , ffzEmotes_(std::make_shared()) , mod_(false) - , titleRefreshedTime_(QTime::currentTime().addSecs(-titleRefreshPeriod_)) + , titleRefreshedTime_(QTime::currentTime().addSecs(-TITLE_REFRESH_PERIOD)) { log("[TwitchChannel:{}] Opened", name); @@ -447,7 +448,7 @@ void TwitchChannel::refreshTitle() return; } - if (this->titleRefreshedTime_.elapsed() < this->titleRefreshPeriod_ * 1000) + if (this->titleRefreshedTime_.elapsed() < TITLE_REFRESH_PERIOD * 1000) { return; } diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index 12f518837..026c90717 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -169,8 +169,6 @@ private: QTimer chattersListTimer_; QTime titleRefreshedTime_; - const int titleRefreshPeriod_ = 10; - friend class TwitchIrcServer; friend class TwitchMessageBuilder; friend class IrcMessageHandler;