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:
@@ -30,7 +30,7 @@ struct Emote {
|
||||
// FOURTF: no solution yet, to be refactored later
|
||||
const QString &getCopyString() const
|
||||
{
|
||||
return name.string;
|
||||
return this->name.string;
|
||||
}
|
||||
|
||||
QJsonObject toJson() const;
|
||||
|
||||
@@ -428,7 +428,7 @@ std::vector<LayeredEmoteElement::Emote> LayeredEmoteElement::getUniqueEmotes()
|
||||
struct NotDuplicate {
|
||||
bool operator()(const Emote &element)
|
||||
{
|
||||
return seen.insert(element.ptr).second;
|
||||
return this->seen.insert(element.ptr).second;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -51,17 +51,17 @@ public:
|
||||
|
||||
const QString &rootId() const
|
||||
{
|
||||
return rootMessageId_;
|
||||
return this->rootMessageId_;
|
||||
}
|
||||
|
||||
const std::shared_ptr<const Message> &root() const
|
||||
{
|
||||
return rootMessage_;
|
||||
return this->rootMessage_;
|
||||
}
|
||||
|
||||
const std::vector<std::weak_ptr<const Message>> &replies() const
|
||||
{
|
||||
return replies_;
|
||||
return this->replies_;
|
||||
}
|
||||
|
||||
QJsonObject toJson() const;
|
||||
|
||||
@@ -57,7 +57,7 @@ struct Selection {
|
||||
, selectionMin(start)
|
||||
, selectionMax(end)
|
||||
{
|
||||
if (selectionMin > selectionMax)
|
||||
if (this->selectionMin > this->selectionMax)
|
||||
{
|
||||
std::swap(this->selectionMin, this->selectionMax);
|
||||
}
|
||||
|
||||
@@ -165,14 +165,14 @@ void MessageLayoutContainer::breakLine()
|
||||
{
|
||||
const int marginOffset = int(MARGIN.left() * this->scale_) +
|
||||
int(MARGIN.right() * this->scale_);
|
||||
xOffset = (width_ - marginOffset -
|
||||
xOffset = (this->width_ - marginOffset -
|
||||
this->elements_.at(this->elements_.size() - 1)
|
||||
->getRect()
|
||||
.right()) /
|
||||
2;
|
||||
}
|
||||
|
||||
for (size_t i = lineStart_; i < this->elements_.size(); i++)
|
||||
for (size_t i = this->lineStart_; i < this->elements_.size(); i++)
|
||||
{
|
||||
MessageLayoutElement *element = this->elements_.at(i).get();
|
||||
|
||||
@@ -199,11 +199,11 @@ void MessageLayoutContainer::breakLine()
|
||||
this->lines_.back().endCharIndex = this->charIndex_;
|
||||
}
|
||||
this->lines_.push_back({
|
||||
.startIndex = lineStart_,
|
||||
.startIndex = this->lineStart_,
|
||||
.endIndex = 0,
|
||||
.startCharIndex = this->charIndex_,
|
||||
.endCharIndex = 0,
|
||||
.rect = QRectF(-100000, this->currentY_, 200000, lineHeight_),
|
||||
.rect = QRectF(-100000, this->currentY_, 200000, this->lineHeight_),
|
||||
});
|
||||
|
||||
for (auto i = this->lineStart_; i < this->elements_.size(); i++)
|
||||
|
||||
@@ -17,8 +17,8 @@ AuthorPredicate::AuthorPredicate(const QString &authors, bool negate)
|
||||
|
||||
bool AuthorPredicate::appliesToImpl(const Message &message)
|
||||
{
|
||||
return authors_.contains(message.displayName, Qt::CaseInsensitive) ||
|
||||
authors_.contains(message.loginName, Qt::CaseInsensitive);
|
||||
return this->authors_.contains(message.displayName, Qt::CaseInsensitive) ||
|
||||
this->authors_.contains(message.loginName, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -35,7 +35,7 @@ bool BadgePredicate::appliesToImpl(const Message &message)
|
||||
{
|
||||
for (const Badge &badge : message.badges)
|
||||
{
|
||||
if (badges_.contains(badge.key_, Qt::CaseInsensitive))
|
||||
if (this->badges_.contains(badge.key_, Qt::CaseInsensitive))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ ChannelPredicate::ChannelPredicate(const QString &channels, bool negate)
|
||||
|
||||
bool ChannelPredicate::appliesToImpl(const Message &message)
|
||||
{
|
||||
return channels_.contains(message.channelName, Qt::CaseInsensitive);
|
||||
return this->channels_.contains(message.channelName, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -71,10 +71,10 @@ bool MessageFlagsPredicate::appliesToImpl(const Message &message)
|
||||
if (this->flags_.has(MessageFlag::System) &&
|
||||
!this->flags_.has(MessageFlag::Timeout))
|
||||
{
|
||||
return message.flags.hasAny(flags_) &&
|
||||
return message.flags.hasAny(this->flags_) &&
|
||||
!message.flags.has(MessageFlag::Timeout);
|
||||
}
|
||||
return message.flags.hasAny(flags_);
|
||||
return message.flags.hasAny(this->flags_);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -12,12 +12,12 @@ RegexPredicate::RegexPredicate(const QString ®ex, bool negate)
|
||||
|
||||
bool RegexPredicate::appliesToImpl(const Message &message)
|
||||
{
|
||||
if (!regex_.isValid())
|
||||
if (!this->regex_.isValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QRegularExpressionMatch match = regex_.match(message.messageText);
|
||||
QRegularExpressionMatch match = this->regex_.match(message.messageText);
|
||||
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ bool SubtierPredicate::appliesToImpl(const Message &message)
|
||||
const auto &subTier =
|
||||
badge.value_.length() > 3 ? badge.value_.at(0) : '1';
|
||||
|
||||
return subtiers_.contains(subTier);
|
||||
return this->subtiers_.contains(subTier);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user