mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
move titleRefreshPeriod out of the TwitchChannel class
this fixes a "use of uninitialized variable" error
This commit is contained in:
parent
ba685b291f
commit
11442bba20
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue