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
+1 -1
View File
@@ -132,7 +132,7 @@ using namespace std::string_literals;
CrashHandler::CrashHandler(const Paths &paths_)
: paths(paths_)
{
auto optSettings = readRecoverySettings(paths);
auto optSettings = readRecoverySettings(this->paths);
if (optSettings)
{
this->shouldRecover_ = *optSettings;
+5 -5
View File
@@ -117,12 +117,12 @@ void Settings::mute(const QString &channelName)
void Settings::unmute(const QString &channelName)
{
for (std::vector<int>::size_type i = 0; i != mutedChannels.raw().size();
i++)
for (std::vector<int>::size_type i = 0;
i != this->mutedChannels.raw().size(); i++)
{
if (mutedChannels.raw()[i].toLower() == channelName.toLower())
if (this->mutedChannels.raw()[i].toLower() == channelName.toLower())
{
mutedChannels.removeAt(i);
this->mutedChannels.removeAt(i);
i--;
}
}
@@ -132,7 +132,7 @@ bool Settings::toggleMutedChannel(const QString &channelName)
{
if (this->isMutedChannel(channelName))
{
unmute(channelName);
this->unmute(channelName);
return false;
}
else
+1 -1
View File
@@ -462,7 +462,7 @@ AvatarDownloader::AvatarDownloader(const QString &avatarURL,
{
this->file_.close();
}
downloadComplete();
this->downloadComplete();
this->deleteLater();
});
}
+2 -2
View File
@@ -104,12 +104,12 @@ void Updates::deleteOldFiles()
const QString &Updates::getCurrentVersion() const
{
return currentVersion_;
return this->currentVersion_;
}
const QString &Updates::getOnlineVersion() const
{
return onlineVersion_;
return this->onlineVersion_;
}
void Updates::installUpdates()
+1 -1
View File
@@ -806,7 +806,7 @@ void WindowManager::closeAll()
qCDebug(chatterinoWindowmanager) << "Shutting down (closing windows)";
this->shuttingDown_ = true;
for (Window *window : windows_)
for (Window *window : this->windows_)
{
closeWindowsRecursive(window);
}
+9 -8
View File
@@ -64,27 +64,28 @@ LoggingChannel::LoggingChannel(QString _channelName, QString _platform)
{
this->subDirectory = "Whispers";
}
else if (channelName.startsWith("/mentions"))
else if (this->channelName.startsWith("/mentions"))
{
this->subDirectory = "Mentions";
}
else if (channelName.startsWith("/live"))
else if (this->channelName.startsWith("/live"))
{
this->subDirectory = "Live";
}
else if (channelName.startsWith("/automod"))
else if (this->channelName.startsWith("/automod"))
{
this->subDirectory = "AutoMod";
}
else
{
this->subDirectory =
QStringLiteral("Channels") + QDir::separator() + channelName;
QStringLiteral("Channels") + QDir::separator() + this->channelName;
}
// enforce capitalized platform names
this->subDirectory = platform[0].toUpper() + platform.mid(1).toLower() +
QDir::separator() + this->subDirectory;
this->subDirectory = this->platform[0].toUpper() +
this->platform.mid(1).toLower() + QDir::separator() +
this->subDirectory;
getSettings()->logPath.connect([this](const QString &logPath, auto) {
this->baseDirectory = logPath.isEmpty()
@@ -196,8 +197,8 @@ void LoggingChannel::addMessage(const MessagePtr &message,
}
QString str;
if (channelName.startsWith("/mentions") ||
channelName.startsWith("/automod"))
if (this->channelName.startsWith("/mentions") ||
this->channelName.startsWith("/automod"))
{
str.append("#" + message->channelName + " ");
}