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
+27 -17
View File
@@ -134,11 +134,12 @@ Split::Split(QWidget *parent)
this->input_->ui_.textEdit->installEventFilter(parent);
this->signalHolder_.managedConnect(
getApp()->accounts->twitch.currentUserChanged,
[this] { this->onAccountSelected(); });
getApp()->accounts->twitch.currentUserChanged, [this] {
this->onAccountSelected();
});
this->onAccountSelected();
this->view_->mouseDown.connect([this](QMouseEvent *) { //
this->view_->mouseDown.connect([this](QMouseEvent *) {
this->giveFocus(Qt::MouseFocusReason);
});
this->view_->selectionChanged.connect([this]() {
@@ -212,10 +213,12 @@ Split::Split(QWidget *parent)
}
});
this->input_->ui_.textEdit->focused.connect(
[this] { this->focused.invoke(); });
this->input_->ui_.textEdit->focusLost.connect(
[this] { this->focusLost.invoke(); });
this->input_->ui_.textEdit->focused.connect([this] {
this->focused.invoke();
});
this->input_->ui_.textEdit->focusLost.connect([this] {
this->focusLost.invoke();
});
this->input_->ui_.textEdit->imagePasted.connect(
[this](const QMimeData *source) {
if (!getSettings()->imageUploaderEnabled)
@@ -249,7 +252,9 @@ Split::Split(QWidget *parent)
});
getSettings()->imageUploaderEnabled.connect(
[this](const bool &val) { this->setAcceptDrops(val); },
[this](const bool &val) {
this->setAcceptDrops(val);
},
this->managedConnections_);
}
@@ -306,7 +311,7 @@ void Split::onAccountSelected()
this->updateTooltipColor();
this->signalHolder_.managedConnect(this->theme->updated, [this]() {
this->updateTooltipColor(); //
this->updateTooltipColor();
});
}
@@ -347,13 +352,16 @@ void Split::setChannel(IndirectChannel newChannel)
this->header_->updateRoomModes();
});
this->roomModeChangedConnection_ = tc->roomModesChanged.connect(
[this] { this->header_->updateRoomModes(); });
this->roomModeChangedConnection_ = tc->roomModesChanged.connect([this] {
this->header_->updateRoomModes();
});
}
this->indirectChannelChangedConnection_ =
newChannel.getChannelChanged().connect([this] { //
QTimer::singleShot(0, [this] { this->setChannel(this->channel_); });
newChannel.getChannelChanged().connect([this] {
QTimer::singleShot(0, [this] {
this->setChannel(this->channel_);
});
});
this->header_->updateModerationModeIcon();
@@ -544,8 +552,9 @@ void Split::deleteFromContainer()
{
this->container_->deleteSplit(this);
auto *tab = this->getContainer()->getTab();
tab->connect(tab, &QWidget::destroyed,
[tab]() mutable { ClosedSplits::invalidateTab(tab); });
tab->connect(tab, &QWidget::destroyed, [tab]() mutable {
ClosedSplits::invalidateTab(tab);
});
ClosedSplits::push({this->getChannel()->getName(), tab});
}
}
@@ -747,8 +756,9 @@ void Split::showViewerList()
}
});
QObject::connect(viewerDock, &QDockWidget::topLevelChanged, this,
[=]() { viewerDock->setMinimumWidth(300); });
QObject::connect(viewerDock, &QDockWidget::topLevelChanged, this, [=]() {
viewerDock->setMinimumWidth(300);
});
auto listDoubleClick = [=](QString userName) {
if (!labels.contains(userName) && !userName.isEmpty())