refactor: fix clang-tidy auto*, const&, and curly braces (#5083)
This commit is contained in:
@@ -52,7 +52,7 @@ void Logging::addMessage(const QString &channelName, MessagePtr message,
|
||||
auto platIt = this->loggingChannels_.find(platformName);
|
||||
if (platIt == this->loggingChannels_.end())
|
||||
{
|
||||
auto channel = new LoggingChannel(channelName, platformName);
|
||||
auto *channel = new LoggingChannel(channelName, platformName);
|
||||
channel->addMessage(message);
|
||||
auto map = std::map<QString, std::unique_ptr<LoggingChannel>>();
|
||||
this->loggingChannels_[platformName] = std::move(map);
|
||||
@@ -63,7 +63,7 @@ void Logging::addMessage(const QString &channelName, MessagePtr message,
|
||||
auto chanIt = platIt->second.find(channelName);
|
||||
if (chanIt == platIt->second.end())
|
||||
{
|
||||
auto channel = new LoggingChannel(channelName, platformName);
|
||||
auto *channel = new LoggingChannel(channelName, platformName);
|
||||
channel->addMessage(message);
|
||||
platIt->second.emplace(channelName, std::move(channel));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,9 @@ bool Settings::isHighlightedUser(const QString &username)
|
||||
for (const auto &highlightedUser : *items)
|
||||
{
|
||||
if (highlightedUser.isMatch(username))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -67,7 +69,9 @@ bool Settings::isBlacklistedUser(const QString &username)
|
||||
for (const auto &blacklistedUser : *items)
|
||||
{
|
||||
if (blacklistedUser.isMatch(username))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -208,7 +212,7 @@ void Settings::saveSnapshot()
|
||||
}
|
||||
|
||||
rapidjson::Value key(setting->getPath().c_str(), a);
|
||||
auto curVal = setting->unmarshalJSON();
|
||||
auto *curVal = setting->unmarshalJSON();
|
||||
if (curVal == nullptr)
|
||||
{
|
||||
continue;
|
||||
|
||||
@@ -97,7 +97,7 @@ WindowManager::WindowManager()
|
||||
{
|
||||
qCDebug(chatterinoWindowmanager) << "init WindowManager";
|
||||
|
||||
auto settings = getSettings();
|
||||
auto *settings = getSettings();
|
||||
|
||||
this->wordFlagsListener_.addSetting(settings->showTimestamps);
|
||||
this->wordFlagsListener_.addSetting(settings->showBadgesGlobalAuthority);
|
||||
@@ -135,7 +135,7 @@ MessageElementFlags WindowManager::getWordFlags()
|
||||
void WindowManager::updateWordTypeMask()
|
||||
{
|
||||
using MEF = MessageElementFlag;
|
||||
auto settings = getSettings();
|
||||
auto *settings = getSettings();
|
||||
|
||||
// text
|
||||
auto flags = MessageElementFlags(MEF::Text);
|
||||
@@ -630,7 +630,7 @@ void WindowManager::encodeChannel(IndirectChannel channel, QJsonObject &obj)
|
||||
}
|
||||
break;
|
||||
case Channel::Type::Irc: {
|
||||
if (auto ircChannel =
|
||||
if (auto *ircChannel =
|
||||
dynamic_cast<IrcChannel *>(channel.get().get()))
|
||||
{
|
||||
obj.insert("type", "irc");
|
||||
@@ -664,7 +664,7 @@ IndirectChannel WindowManager::decodeChannel(const SplitDescriptor &descriptor)
|
||||
{
|
||||
assertInGuiThread();
|
||||
|
||||
auto app = getApp();
|
||||
auto *app = getApp();
|
||||
|
||||
if (descriptor.type_ == "twitch")
|
||||
{
|
||||
|
||||
@@ -13,15 +13,21 @@ void GIFTimer::initialize()
|
||||
|
||||
getSettings()->animateEmotes.connect([this](bool enabled, auto) {
|
||||
if (enabled)
|
||||
{
|
||||
this->timer.start();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->timer.stop();
|
||||
}
|
||||
});
|
||||
|
||||
QObject::connect(&this->timer, &QTimer::timeout, [this] {
|
||||
if (getSettings()->animationsWhenFocused &&
|
||||
qApp->activeWindow() == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->position_ += GIF_FRAME_LENGTH;
|
||||
this->signal.invoke();
|
||||
|
||||
Reference in New Issue
Block a user