Fix signal connection nodiscard warnings (#4818)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user