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:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
|
||||
~StackGuard()
|
||||
{
|
||||
if (expected < 0)
|
||||
if (this->expected < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -442,7 +442,7 @@ private:
|
||||
}
|
||||
else
|
||||
{
|
||||
return visitOne<TReturn, Rest...>(
|
||||
return this->visitOne<TReturn, Rest...>(
|
||||
std::forward<decltype(rest)>(rest)...);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ struct UserData {
|
||||
|
||||
bool isEmpty() const
|
||||
{
|
||||
return !color.has_value() && notes.isEmpty();
|
||||
return !this->color.has_value() && this->notes.isEmpty();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user