Update Settings and Signals version (#3398)

Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
pajlada
2021-12-19 15:57:56 +01:00
committed by GitHub
parent 60ff82f2de
commit 51ece94f58
39 changed files with 282 additions and 268 deletions
+18 -25
View File
@@ -430,12 +430,6 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent)
this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Policy::Ignored);
}
// remove once https://github.com/pajlada/signals/pull/10 gets merged
UserInfoPopup::~UserInfoPopup()
{
this->refreshConnection_.disconnect();
}
void UserInfoPopup::themeChangedEvent()
{
BaseWindow::themeChangedEvent();
@@ -601,26 +595,25 @@ void UserInfoPopup::updateLatestMessages()
// shrink dialog in case ChannelView goes from visible to hidden
this->adjustSize();
this->refreshConnection_
.disconnect(); // remove once https://github.com/pajlada/signals/pull/10 gets merged
this->refreshConnection_ =
std::make_unique<pajlada::Signals::ScopedConnection>(
this->channel_->messageAppended.connect([this, hasMessages](
auto message, auto) {
if (!checkMessageUserName(this->userName_, message))
return;
this->refreshConnection_ = this->channel_->messageAppended.connect(
[this, hasMessages](auto message, auto) {
if (!checkMessageUserName(this->userName_, message))
return;
if (hasMessages)
{
// display message in ChannelView
this->ui_.latestMessages->channel()->addMessage(message);
}
else
{
// The ChannelView is currently hidden, so manually refresh
// and display the latest messages
this->updateLatestMessages();
}
});
if (hasMessages)
{
// display message in ChannelView
this->ui_.latestMessages->channel()->addMessage(message);
}
else
{
// The ChannelView is currently hidden, so manually refresh
// and display the latest messages
this->updateLatestMessages();
}
}));
}
void UserInfoPopup::updateUserData()