Fix signal connection nodiscard warnings (#4818)

This commit is contained in:
pajlada
2023-09-16 13:52:51 +02:00
committed by GitHub
parent 2d5f078306
commit 8fe3af3522
40 changed files with 709 additions and 554 deletions
+18 -11
View File
@@ -438,8 +438,10 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
});
// userstate
this->userStateChanged_.connect([this, mod, unmod, vip,
unvip]() mutable {
// We can safely ignore this signal connection since this is a private signal, and
// we only connect once
std::ignore = this->userStateChanged_.connect([this, mod, unmod, vip,
unvip]() mutable {
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->underlyingChannel_.get());
@@ -469,17 +471,22 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent,
{
auto timeout = moderation.emplace<TimeoutWidget>();
this->userStateChanged_.connect([this, lineMod, timeout]() mutable {
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->underlyingChannel_.get());
// We can safely ignore this signal connection since this is a private signal, and
// we only connect once
std::ignore =
this->userStateChanged_.connect([this, lineMod, timeout]() mutable {
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(
this->underlyingChannel_.get());
bool hasModRights =
twitchChannel ? twitchChannel->hasModRights() : false;
lineMod->setVisible(hasModRights);
timeout->setVisible(hasModRights);
});
bool hasModRights =
twitchChannel ? twitchChannel->hasModRights() : false;
lineMod->setVisible(hasModRights);
timeout->setVisible(hasModRights);
});
timeout->buttonClicked.connect([this](auto item) {
// We can safely ignore this signal connection since we own the button, and
// the button will always be destroyed before the UserInfoPopup
std::ignore = timeout->buttonClicked.connect([this](auto item) {
TimeoutWidget::Action action;
int arg;
std::tie(action, arg) = item;