refactor: add explicit this-> where possible

I have knowingly skipped some files/portions of files where this would
create merge conflicts for other open PRs.
This commit is contained in:
Rasmus Karlsson
2025-12-30 13:30:57 +01:00
committed by pajlada
parent e0101f71c2
commit 57d6583a2b
64 changed files with 180 additions and 177 deletions
@@ -21,10 +21,10 @@ std::optional<EmotePtr> ChatterinoBadges::getBadge(const UserId &id)
{
std::shared_lock lock(this->mutex_);
auto it = badgeMap.find(id.string);
if (it != badgeMap.end())
auto it = this->badgeMap.find(id.string);
if (it != this->badgeMap.end())
{
return emotes[it->second];
return this->emotes[it->second];
}
return std::nullopt;
}
@@ -66,12 +66,12 @@ void ChatterinoBadges::loadChatterinoBadges()
.homePage = Url{},
};
emotes.push_back(
this->emotes.push_back(
std::make_shared<const Emote>(std::move(emote)));
for (const auto &user : jsonBadge.value("users").toArray())
{
badgeMap[user.toString()] = index;
this->badgeMap[user.toString()] = index;
}
++index;
}
@@ -143,7 +143,7 @@ private:
this->connectBackoff_.reset();
auto *client = resolve(id);
auto *client = this->resolve(id);
client->onOpen();
auto pendingSubsToTake = std::min(this->pendingSubscriptions_.size(),
client->maxSubscriptions);
+1 -1
View File
@@ -18,7 +18,7 @@ bool UserPronouns::isUnspecified() const
UserPronouns::operator bool() const
{
return !isUnspecified();
return !this->isUnspecified();
}
} // namespace chatterino::pronouns
+1 -1
View File
@@ -12,7 +12,7 @@ public:
QString format() const
{
if (isUnspecified())
if (this->isUnspecified())
{
return "unspecified";
}
+2 -2
View File
@@ -58,13 +58,13 @@ ChannelPointReward::ChannelPointReward(const QJsonObject &redemption)
}
// use bits cost when channel points were not used
if (cost == 0)
if (this->cost == 0)
{
this->cost = reward.value("bits_cost").toInt();
}
// workaround twitch bug where bits_cost is always 0 in practice
if (cost == 0)
if (this->cost == 0)
{
this->cost = reward.value("default_bits_cost").toInt();
}
+3 -3
View File
@@ -8,17 +8,17 @@ struct EmoteValue {
public:
int getSet()
{
return set_;
return this->set_;
}
int getId()
{
return id_;
return this->id_;
}
const QString &getChannelName()
{
return channelName_;
return this->channelName_;
}
private:
+1 -1
View File
@@ -1196,7 +1196,7 @@ void TwitchChannel::updateSeventvUser(
return;
}
updateSeventvData(this->seventvUserID_, dispatch.emoteSetID);
this->updateSeventvData(this->seventvUserID_, dispatch.emoteSetID);
SeventvEmotes::getEmoteSet(
dispatch.emoteSetID,
[this, weak = weakOf<Channel>(this), dispatch](auto &&emotes,
+1 -1
View File
@@ -393,7 +393,7 @@ struct HelixBadgeSet {
const auto jsonVersions = json.value("versions").toArray();
for (const auto &version : jsonVersions)
{
versions.emplace_back(version.toObject());
this->versions.emplace_back(version.toObject());
}
}
};
@@ -161,9 +161,9 @@ void EventSubMessageBuilder::appendUser(const lib::String &userName,
QString &text, bool trailingSpace)
{
auto login = userLogin.qt();
auto *el = this->emplace<MentionElement>(userName.qt(), login,
MessageColor::System,
channel->getUserColor(login));
auto *el = this->emplace<MentionElement>(
userName.qt(), login, MessageColor::System,
this->channel->getUserColor(login));
text.append(login);
if (trailingSpace)
@@ -19,7 +19,7 @@ RawSubscriptionHandle::~RawSubscriptionHandle()
// We're shutting down, assume the unsubscription has been taken care of
return;
}
app->getEventSub()->removeRef(request);
app->getEventSub()->removeRef(this->request);
}
} // namespace chatterino::eventsub