From 4138e53ac44e08bb21c3a2ec4033d3b5041e012b Mon Sep 17 00:00:00 2001 From: ZeldaZach Date: Sun, 1 Dec 2024 20:25:49 -0500 Subject: [PATCH] Support new SIG/SLOT for TabAccount --- cockatrice/src/client/tabs/tab_account.cpp | 41 +++++++++------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_account.cpp b/cockatrice/src/client/tabs/tab_account.cpp index fab79bea1..efe5e70a3 100644 --- a/cockatrice/src/client/tabs/tab_account.cpp +++ b/cockatrice/src/client/tabs/tab_account.cpp @@ -30,29 +30,22 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor, userInfoBox = new UserInfoBox(client, true); userInfoBox->updateInfo(userInfo); - connect(allUsersList, SIGNAL(openMessageDialog(const QString &, bool)), this, - SIGNAL(openMessageDialog(const QString &, bool))); - connect(buddyList, SIGNAL(openMessageDialog(const QString &, bool)), this, - SIGNAL(openMessageDialog(const QString &, bool))); - connect(ignoreList, SIGNAL(openMessageDialog(const QString &, bool)), this, - SIGNAL(openMessageDialog(const QString &, bool))); + connect(allUsersList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog); + connect(buddyList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog); + connect(ignoreList, &UserList::openMessageDialog, this, &TabUserLists::openMessageDialog); - connect(client, SIGNAL(userJoinedEventReceived(const Event_UserJoined &)), this, - SLOT(processUserJoinedEvent(const Event_UserJoined &))); - connect(client, SIGNAL(userLeftEventReceived(const Event_UserLeft &)), this, - SLOT(processUserLeftEvent(const Event_UserLeft &))); - connect(client, SIGNAL(buddyListReceived(const QList &)), this, - SLOT(buddyListReceived(const QList &))); - connect(client, SIGNAL(ignoreListReceived(const QList &)), this, - SLOT(ignoreListReceived(const QList &))); - connect(client, SIGNAL(addToListEventReceived(const Event_AddToList &)), this, - SLOT(processAddToListEvent(const Event_AddToList &))); - connect(client, SIGNAL(removeFromListEventReceived(const Event_RemoveFromList &)), this, - SLOT(processRemoveFromListEvent(const Event_RemoveFromList &))); + connect(client, &AbstractClient::userJoinedEventReceived, this, &TabUserLists::processUserJoinedEvent); + connect(client, &AbstractClient::userLeftEventReceived, this, &TabUserLists::processUserLeftEvent); + connect(client, &AbstractClient::buddyListReceived, this, &TabUserLists::buddyListReceived); + connect(client, &AbstractClient::ignoreListReceived, this, &TabUserLists::ignoreListReceived); + connect(client, &AbstractClient::addToListEventReceived, this, &TabUserLists::processAddToListEvent); + connect(client, &AbstractClient::removeFromListEventReceived, this, &TabUserLists::processRemoveFromListEvent); PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers()); - connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, - SLOT(processListUsersResponse(const Response &))); + connect(pend, + static_cast( + &PendingCommand::finished), + this, &TabUserLists::processListUsersResponse); client->sendCommand(pend); QVBoxLayout *vbox = new QVBoxLayout; @@ -63,9 +56,9 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor, addBuddyEdit = new LineEditUnfocusable; addBuddyEdit->setMaxLength(MAX_NAME_LENGTH); addBuddyEdit->setPlaceholderText(tr("Add to Buddy List")); - connect(addBuddyEdit, SIGNAL(returnPressed()), this, SLOT(addToBuddyList())); + connect(addBuddyEdit, &LineEditUnfocusable::returnPressed, this, &TabUserLists::addToBuddyList); QPushButton *addBuddyButton = new QPushButton("Add"); - connect(addBuddyButton, SIGNAL(clicked()), this, SLOT(addToBuddyList())); + connect(addBuddyButton, &QPushButton::clicked, this, &TabUserLists::addToBuddyList); addToBuddyList->addWidget(addBuddyEdit); addToBuddyList->addWidget(addBuddyButton); @@ -73,9 +66,9 @@ TabUserLists::TabUserLists(TabSupervisor *_tabSupervisor, addIgnoreEdit = new LineEditUnfocusable; addIgnoreEdit->setMaxLength(MAX_NAME_LENGTH); addIgnoreEdit->setPlaceholderText(tr("Add to Ignore List")); - connect(addIgnoreEdit, SIGNAL(returnPressed()), this, SLOT(addToIgnoreList())); + connect(addIgnoreEdit, &LineEditUnfocusable::returnPressed, this, &TabUserLists::addToIgnoreList); QPushButton *addIgnoreButton = new QPushButton("Add"); - connect(addIgnoreButton, SIGNAL(clicked()), this, SLOT(addToIgnoreList())); + connect(addIgnoreButton, &QPushButton::clicked, this, &TabUserLists::addToIgnoreList); addToIgnoreList->addWidget(addIgnoreEdit); addToIgnoreList->addWidget(addIgnoreButton);