mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-28 08:52: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
|
// Forward join requests from popup upward
|
||||||
connect(m_userInfoPopup, &UserInfoPopup::joinGameRequested, this, &UserListWidget::joinGameRequested);
|
connect(m_userInfoPopup, &UserInfoPopup::joinGameRequested, this, &UserListWidget::joinGameRequested);
|
||||||
|
|
||||||
connect(avatarProvider, &UserAvatarProvider::avatarUpdated, this, [this](const QString &name) {
|
connect(avatarProvider, &UserAvatarProvider::avatarUpdated, this, &UserListWidget::refreshVisibleUserHeader);
|
||||||
userTree->viewport()->update();
|
connect(cardArtProvider, &UserCardArtProvider::cardArtUpdated, this, &UserListWidget::refreshVisibleUserHeader);
|
||||||
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(&SettingsCache::instance().appearance(), &AppearanceSettings::styleUserListChanged, this,
|
connect(&SettingsCache::instance().appearance(), &AppearanceSettings::styleUserListChanged, this,
|
||||||
&UserListWidget::applyDisplayMode);
|
&UserListWidget::applyDisplayMode);
|
||||||
|
|
@ -643,6 +633,14 @@ void UserListWidget::bind(UserListManager *mgr)
|
||||||
rebuild();
|
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)
|
void UserListWidget::refreshPopupButtons(const QString &userName)
|
||||||
{
|
{
|
||||||
UserListTWI *item = users.value(userName);
|
UserListTWI *item = users.value(userName);
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,7 @@ private:
|
||||||
void refreshPopupButtons(const QString &userName);
|
void refreshPopupButtons(const QString &userName);
|
||||||
private slots:
|
private slots:
|
||||||
void userClicked(QTreeWidgetItem *item, int column);
|
void userClicked(QTreeWidgetItem *item, int column);
|
||||||
|
void refreshVisibleUserHeader(const QString &name);
|
||||||
signals:
|
signals:
|
||||||
void openMessageDialog(const QString &userName, bool focus);
|
void openMessageDialog(const QString &userName, bool focus);
|
||||||
void addBuddy(const QString &userName);
|
void addBuddy(const QString &userName);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue