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
@@ -23,7 +23,7 @@ void CommandStrategy::apply(const std::vector<CommandItem> &items,
{
QString normalizedQuery = normalizeQuery(query);
if (startsWithOnly_)
if (this->startsWithOnly_)
{
std::copy_if(items.begin(), items.end(),
std::back_insert_iterator(output),
+1 -1
View File
@@ -37,7 +37,7 @@ struct ActionDefinition {
uint8_t minCountArguments = 0;
// maxCountArguments is the maximum amount of arguments the action accepts
uint8_t maxCountArguments = minCountArguments;
uint8_t maxCountArguments = this->minCountArguments;
// possibleArguments is empty or contains all possible argument values,
// it is an ordered mapping from option name (what the user sees) to
+2 -2
View File
@@ -17,12 +17,12 @@ IgnorePhrase::IgnorePhrase(const QString &pattern, bool isRegex, bool isBlock,
{
if (this->isCaseSensitive_)
{
regex_.setPatternOptions(
this->regex_.setPatternOptions(
QRegularExpression::UseUnicodePropertiesOption);
}
else
{
regex_.setPatternOptions(
this->regex_.setPatternOptions(
QRegularExpression::CaseInsensitiveOption |
QRegularExpression::UseUnicodePropertiesOption);
}
@@ -64,7 +64,7 @@ void NotificationController::updateChannelNotification(
bool NotificationController::isChannelNotified(const QString &channelName,
Platform p) const
{
return ranges::any_of(channelMap.at(p).raw(), [&](const auto &name) {
return ranges::any_of(this->channelMap.at(p).raw(), [&](const auto &name) {
return name.compare(channelName, Qt::CaseInsensitive) == 0;
});
}
@@ -72,19 +72,19 @@ bool NotificationController::isChannelNotified(const QString &channelName,
void NotificationController::addChannelNotification(const QString &channelName,
Platform p)
{
channelMap[p].append(channelName);
this->channelMap[p].append(channelName);
}
void NotificationController::removeChannelNotification(
const QString &channelName, Platform p)
{
for (std::vector<int>::size_type i = 0; i != channelMap[p].raw().size();
i++)
for (std::vector<int>::size_type i = 0;
i != this->channelMap[p].raw().size(); i++)
{
if (channelMap[p].raw()[i].compare(channelName, Qt::CaseInsensitive) ==
0)
if (this->channelMap[p].raw()[i].compare(channelName,
Qt::CaseInsensitive) == 0)
{
channelMap[p].removeAt(static_cast<int>(i));
this->channelMap[p].removeAt(static_cast<int>(i));
i--;
}
}
@@ -173,9 +173,9 @@ void NotificationController::fetchFakeChannels()
qCDebug(chatterinoNotification) << "fetching fake channels";
QStringList channels;
for (size_t i = 0; i < channelMap[Platform::Twitch].raw().size(); i++)
for (size_t i = 0; i < this->channelMap[Platform::Twitch].raw().size(); i++)
{
const auto &name = channelMap[Platform::Twitch].raw()[i];
const auto &name = this->channelMap[Platform::Twitch].raw()[i];
auto chan = getApp()->getTwitch()->getChannelOrEmpty(name);
if (chan->isEmpty())
{
+1 -1
View File
@@ -76,7 +76,7 @@ public:
~StackGuard()
{
if (expected < 0)
if (this->expected < 0)
{
return;
}
+1 -1
View File
@@ -442,7 +442,7 @@ private:
}
else
{
return visitOne<TReturn, Rest...>(
return this->visitOne<TReturn, Rest...>(
std::forward<decltype(rest)>(rest)...);
}
}
+1 -1
View File
@@ -118,7 +118,7 @@ void TwitchLiveController::request(std::optional<QStringList> optChannelIDs)
for (const auto &result : results)
{
auto it = this->channels.find(result.first);
if (it != channels.end())
if (it != this->channels.end())
{
if (auto channel = it->second.ptr.lock(); channel)
{
+1 -1
View File
@@ -21,7 +21,7 @@ struct UserData {
bool isEmpty() const
{
return !color.has_value() && notes.isEmpty();
return !this->color.has_value() && this->notes.isEmpty();
}
};