Chore: Proper Lambda Formatting (#2167)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Leon Richardt
2020-11-08 12:02:19 +01:00
committed by GitHub
parent fbd5df53d8
commit 0eed45ae67
71 changed files with 712 additions and 415 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ Emotes::Emotes()
void Emotes::initialize(Settings &settings, Paths &paths)
{
getApp()->accounts->twitch.currentUserChanged.connect(
[] { getApp()->accounts->twitch.getCurrent()->loadEmotes(); });
getApp()->accounts->twitch.currentUserChanged.connect([] {
getApp()->accounts->twitch.getCurrent()->loadEmotes();
});
this->emojis.load();
+1 -1
View File
@@ -44,7 +44,7 @@ QString Paths::cacheDirectory()
QStringSetting cachePathSetting("/cache/path");
cachePathSetting.connect([](const auto &newPath, auto) {
QDir().mkpath(newPath); //
QDir().mkpath(newPath);
});
return cachePathSetting;
+4 -1
View File
@@ -125,7 +125,10 @@ Settings::Settings(const QString &settingsDirectory)
#ifdef USEWINSDK
this->autorun = isRegisteredForStartup();
this->autorun.connect(
[](bool autorun) { setRegisteredForStartup(autorun); }, false);
[](bool autorun) {
setRegisteredForStartup(autorun);
},
false);
#endif
}
+11 -3
View File
@@ -13,8 +13,16 @@ Theme::Theme()
{
this->update();
this->themeName.connectSimple([this](auto) { this->update(); }, false);
this->themeHue.connectSimple([this](auto) { this->update(); }, false);
this->themeName.connectSimple(
[this](auto) {
this->update();
},
false);
this->themeHue.connectSimple(
[this](auto) {
this->update();
},
false);
}
// hue: theme color (0 - 1)
@@ -60,7 +68,7 @@ void Theme::actuallyUpdate(double hue, double multiplier)
this->splits.input.styleSheet =
"background:" + this->splits.input.background.name() + ";" +
"border:" + this->tabs.selected.backgrounds.regular.color().name() +
";" + "color:" + this->messages.textColors.regular.name() + ";" + //
";" + "color:" + this->messages.textColors.regular.name() + ";" +
"selection-background-color:" +
(isLight ? "#68B1FF"
: this->tabs.selected.backgrounds.regular.color().name());
+3 -1
View File
@@ -362,7 +362,9 @@ void Updates::setStatus_(Status status)
if (this->status_ != status)
{
this->status_ = status;
postToThread([this, status] { this->statusUpdated.invoke(status); });
postToThread([this, status] {
this->statusUpdated.invoke(status);
});
}
}
+27 -19
View File
@@ -100,7 +100,7 @@ WindowManager::WindowManager()
this->wordFlagsListener_.addSetting(settings->boldUsernames);
this->wordFlagsListener_.addSetting(settings->lowercaseDomains);
this->wordFlagsListener_.setCB([this] {
this->updateWordTypeMask(); //
this->updateWordTypeMask();
});
this->saveTimer = new QTimer;
@@ -108,13 +108,13 @@ WindowManager::WindowManager()
this->saveTimer->setSingleShot(true);
QObject::connect(this->saveTimer, &QTimer::timeout, [] {
getApp()->windows->save(); //
getApp()->windows->save();
});
this->miscUpdateTimer_.start(100);
QObject::connect(&this->miscUpdateTimer_, &QTimer::timeout, [this] {
this->miscUpdate.invoke(); //
this->miscUpdate.invoke();
});
}
@@ -289,8 +289,9 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
{
assertInGuiThread();
getApp()->themes->repaintVisibleChatWidgets_.connect(
[this] { this->repaintVisibleChatWidgets(); });
getApp()->themes->repaintVisibleChatWidgets_.connect([this] {
this->repaintVisibleChatWidgets();
});
assert(!this->initialized_);
@@ -309,22 +310,29 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
mainWindow_->getNotebook().addPage(true);
}
settings.timestampFormat.connect(
[this](auto, auto) { this->layoutChannelViews(); });
settings.timestampFormat.connect([this](auto, auto) {
this->layoutChannelViews();
});
settings.emoteScale.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.emoteScale.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
settings.timestampFormat.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.alternateMessages.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.separateMessages.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.collpseMessagesMinLines.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.enableRedeemedHighlight.connect(
[this](auto, auto) { this->forceLayoutChannelViews(); });
settings.timestampFormat.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
settings.alternateMessages.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
settings.separateMessages.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
settings.collpseMessagesMinLines.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
settings.enableRedeemedHighlight.connect([this](auto, auto) {
this->forceLayoutChannelViews();
});
this->initialized_ = true;
}