move titleRefreshPeriod out of the TwitchChannel class

this fixes a "use of uninitialized variable" error
This commit is contained in:
Rasmus Karlsson 2019-12-16 08:55:38 +01:00
parent ba685b291f
commit 11442bba20
2 changed files with 3 additions and 4 deletions

View file

@ -31,6 +31,7 @@
namespace chatterino { namespace chatterino {
namespace { namespace {
constexpr int TITLE_REFRESH_PERIOD = 10;
constexpr char MAGIC_MESSAGE_SUFFIX[] = u8" \U000E0000"; constexpr char MAGIC_MESSAGE_SUFFIX[] = u8" \U000E0000";
// parseRecentMessages takes a json object and returns a vector of // parseRecentMessages takes a json object and returns a vector of
@ -89,7 +90,7 @@ TwitchChannel::TwitchChannel(const QString &name,
, bttvEmotes_(std::make_shared<EmoteMap>()) , bttvEmotes_(std::make_shared<EmoteMap>())
, ffzEmotes_(std::make_shared<EmoteMap>()) , ffzEmotes_(std::make_shared<EmoteMap>())
, mod_(false) , mod_(false)
, titleRefreshedTime_(QTime::currentTime().addSecs(-titleRefreshPeriod_)) , titleRefreshedTime_(QTime::currentTime().addSecs(-TITLE_REFRESH_PERIOD))
{ {
log("[TwitchChannel:{}] Opened", name); log("[TwitchChannel:{}] Opened", name);
@ -447,7 +448,7 @@ void TwitchChannel::refreshTitle()
return; return;
} }
if (this->titleRefreshedTime_.elapsed() < this->titleRefreshPeriod_ * 1000) if (this->titleRefreshedTime_.elapsed() < TITLE_REFRESH_PERIOD * 1000)
{ {
return; return;
} }

View file

@ -169,8 +169,6 @@ private:
QTimer chattersListTimer_; QTimer chattersListTimer_;
QTime titleRefreshedTime_; QTime titleRefreshedTime_;
const int titleRefreshPeriod_ = 10;
friend class TwitchIrcServer; friend class TwitchIrcServer;
friend class TwitchMessageBuilder; friend class TwitchMessageBuilder;
friend class IrcMessageHandler; friend class IrcMessageHandler;