mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 00:42:19 -07:00
Extract slot to method
Took 10 minutes
This commit is contained in:
parent
b580bb8428
commit
0cdd474267
2 changed files with 11 additions and 12 deletions
|
|
@ -550,18 +550,8 @@ UserListWidget::UserListWidget(TabSupervisor *_tabSupervisor,
|
|||
// Forward join requests from popup upward
|
||||
connect(m_userInfoPopup, &UserInfoPopup::joinGameRequested, this, &UserListWidget::joinGameRequested);
|
||||
|
||||
connect(avatarProvider, &UserAvatarProvider::avatarUpdated, this, [this](const QString &name) {
|
||||
userTree->viewport()->update();
|
||||
if (m_userInfoPopup->isVisible() && m_userInfoPopup->currentUser() == name) {
|
||||
m_userInfoPopup->refreshHeader();
|
||||
}
|
||||
});
|
||||
connect(cardArtProvider, &UserCardArtProvider::cardArtUpdated, this, [this](const QString &name) {
|
||||
userTree->viewport()->update();
|
||||
if (m_userInfoPopup->isVisible() && m_userInfoPopup->currentUser() == name) {
|
||||
m_userInfoPopup->refreshHeader();
|
||||
}
|
||||
});
|
||||
connect(avatarProvider, &UserAvatarProvider::avatarUpdated, this, &UserListWidget::refreshVisibleUserHeader);
|
||||
connect(cardArtProvider, &UserCardArtProvider::cardArtUpdated, this, &UserListWidget::refreshVisibleUserHeader);
|
||||
|
||||
connect(&SettingsCache::instance().appearance(), &AppearanceSettings::styleUserListChanged, this,
|
||||
&UserListWidget::applyDisplayMode);
|
||||
|
|
@ -643,6 +633,14 @@ void UserListWidget::bind(UserListManager *mgr)
|
|||
rebuild();
|
||||
}
|
||||
|
||||
void UserListWidget::refreshVisibleUserHeader(const QString &name)
|
||||
{
|
||||
userTree->viewport()->update();
|
||||
if (m_userInfoPopup->isVisible() && m_userInfoPopup->currentUser() == name) {
|
||||
m_userInfoPopup->refreshHeader();
|
||||
}
|
||||
}
|
||||
|
||||
void UserListWidget::refreshPopupButtons(const QString &userName)
|
||||
{
|
||||
UserListTWI *item = users.value(userName);
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ private:
|
|||
void refreshPopupButtons(const QString &userName);
|
||||
private slots:
|
||||
void userClicked(QTreeWidgetItem *item, int column);
|
||||
void refreshVisibleUserHeader(const QString &name);
|
||||
signals:
|
||||
void openMessageDialog(const QString &userName, bool focus);
|
||||
void addBuddy(const QString &userName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue