delete overloaded signal in PendingCommand (#5477)
Some checks failed
Build Desktop / Configure (push) Waiting to run
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, 12) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Debian, DEB, skip, 11) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, 41) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Fedora, RPM, skip, 40) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, 24.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 20.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (Ubuntu, DEB, skip, 22.04) (push) Blocked by required conditions
Build Desktop / ${{matrix.distro}} ${{matrix.version}} (yes, Arch, skip) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-14, Apple, 14, Release, 15.4) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, 1, macos-15, Apple, 15, Release, 16.2) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (3, macos-15, Apple, 15, Debug, 16.2) (push) Blocked by required conditions
Build Desktop / macOS ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} (4, 1, macos-13, Intel, 13, Release, 14.3.1) (push) Blocked by required conditions
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, 5.15.*, 7) (push) Blocked by required conditions
Build Desktop / Windows ${{matrix.target}} (msvc2019_64, qtimageformats qtmultimedia qtwebsockets, 6.6.*, 10) (push) Blocked by required conditions
Build Web / React (Node ${{matrix.node_version}}) (16) (push) Has been cancelled
Build Web / React (Node ${{matrix.node_version}}) (lts/*) (push) Has been cancelled

* remove overloaded signal since no one was using it

* remove usages of qOverload

* turns out new slot/signal syntax can ignore extra params
This commit is contained in:
RickyRister
2025-01-15 05:16:06 -08:00
committed by GitHub
parent 3a740f0bde
commit 2d02955f8b
11 changed files with 21 additions and 39 deletions

View File

@@ -39,10 +39,7 @@ TabAccount::TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
connect(client, &AbstractClient::removeFromListEventReceived, this, &TabAccount::processRemoveFromListEvent);
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
connect(pend,
static_cast<void (PendingCommand::*)(const Response &, const CommandContainer &, const QVariant &)>(
&PendingCommand::finished),
this, &TabAccount::processListUsersResponse);
connect(pend, &PendingCommand::finished, this, &TabAccount::processListUsersResponse);
client->sendCommand(pend);
QVBoxLayout *vbox = new QVBoxLayout;

View File

@@ -170,9 +170,7 @@ void TabAdmin::actGrantReplayAccess()
cmd.set_moderator_name(client->getUserName().toStdString());
auto *pend = client->prepareModeratorCommand(cmd);
connect(pend,
QOverload<const Response &, const CommandContainer &, const QVariant &>::of(&PendingCommand::finished),
this, &TabAdmin::grantReplayAccessProcessResponse);
connect(pend, &PendingCommand::finished, this, &TabAdmin::grantReplayAccessProcessResponse);
client->sendCommand(pend);
}
@@ -193,7 +191,7 @@ void TabAdmin::actForceActivateUser()
client->sendCommand(pend);
}
void TabAdmin::grantReplayAccessProcessResponse(const Response &response, const CommandContainer &, const QVariant &)
void TabAdmin::grantReplayAccessProcessResponse(const Response &response)
{
auto *event = new Event_ReplayAdded();
@@ -211,7 +209,7 @@ void TabAdmin::grantReplayAccessProcessResponse(const Response &response, const
}
}
void TabAdmin::activateUserProcessResponse(const Response &response, const CommandContainer &, const QVariant &)
void TabAdmin::activateUserProcessResponse(const Response &response)
{
switch (response.response_code()) {
case Response::RespActivationAccepted:

View File

@@ -47,8 +47,8 @@ private slots:
void actReloadConfig();
void actGrantReplayAccess();
void actForceActivateUser();
void grantReplayAccessProcessResponse(const Response &resp, const CommandContainer &, const QVariant &);
void activateUserProcessResponse(const Response &response, const CommandContainer &, const QVariant &);
void grantReplayAccessProcessResponse(const Response &response);
void activateUserProcessResponse(const Response &response);
void actUnlock();
void actLock();

View File

@@ -194,9 +194,7 @@ void GameSelector::actCreate()
updateTitle();
}
void GameSelector::checkResponse(const Response &response,
const CommandContainer & /* commandContainer */,
const QVariant & /* extraData */)
void GameSelector::checkResponse(const Response &response)
{
// NB: We re-enable buttons for the currently selected game, which may not
// be the same game as the one for which we are processing a response.
@@ -274,8 +272,7 @@ void GameSelector::actJoin()
}
PendingCommand *pend = r->prepareRoomCommand(cmd);
connect(pend, qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
this, &GameSelector::checkResponse);
connect(pend, &PendingCommand::finished, this, &GameSelector::checkResponse);
r->sendRoomCommand(pend);
disableButtons();

View File

@@ -29,7 +29,7 @@ private slots:
void actCreate();
void actJoin();
void actSelectedGameChanged(const QModelIndex &current, const QModelIndex &previous);
void checkResponse(const Response &response, const CommandContainer &, const QVariant &);
void checkResponse(const Response &response);
void ignoreListReceived(const QList<ServerInfo_User> &_ignoreList);
void processAddToListEvent(const Event_AddToList &event);

View File

@@ -77,9 +77,7 @@ void ZoneViewZone::initializeCards(const QList<const ServerInfo_Card *> &cardLis
cmd.set_is_reversed(isReversed);
PendingCommand *pend = player->prepareGameCommand(cmd);
connect(pend,
qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
this, &ZoneViewZone::zoneDumpReceived);
connect(pend, &PendingCommand::finished, this, &ZoneViewZone::zoneDumpReceived);
player->sendGameCommand(pend);
} else {
const CardList &c = origZone->getCards();
@@ -93,9 +91,7 @@ void ZoneViewZone::initializeCards(const QList<const ServerInfo_Card *> &cardLis
}
}
void ZoneViewZone::zoneDumpReceived(const Response &r,
const CommandContainer & /* commandContainer */,
const QVariant & /* extraData */)
void ZoneViewZone::zoneDumpReceived(const Response &r)
{
const Response_DumpZone &resp = r.GetExtension(Response_DumpZone::ext);
const int respCardListSize = resp.zone_info().card_list_size();

View File

@@ -95,7 +95,7 @@ public slots:
void setSortBy(CardList::SortOption _sortBy);
void setPileView(int _pileView);
private slots:
void zoneDumpReceived(const Response &r, const CommandContainer &, const QVariant &);
void zoneDumpReceived(const Response &r);
signals:
void beingDeleted();
void optimumRectChanged();

View File

@@ -23,7 +23,6 @@ QVariant PendingCommand::getExtraData() const
void PendingCommand::processResponse(const Response &response)
{
emit finished(response, commandContainer, extraData);
emit finished(response.response_code());
}
int PendingCommand::tick()

View File

@@ -11,7 +11,6 @@ class PendingCommand : public QObject
Q_OBJECT
signals:
void finished(const Response &response, const CommandContainer &commandContainer, const QVariant &extraData);
void finished(Response::ResponseCode respCode);
private:
CommandContainer commandContainer;

View File

@@ -250,17 +250,14 @@ void UserInfoBox::actPassword()
cmd.set_user_name(client->getUserName().toStdString());
PendingCommand *pend = client->prepareSessionCommand(cmd);
connect(pend,
// we need qoverload here in order to select the right version of this function
QOverload<const Response &, const CommandContainer &, const QVariant &>::of(&PendingCommand::finished),
this, [=, this](const Response &response, const CommandContainer &, const QVariant &) {
if (response.response_code() == Response::RespOk) {
changePassword(oldPassword, newPassword);
} else {
QMessageBox::critical(this, tr("Error"),
tr("An error occurred while trying to update your user information."));
}
});
connect(pend, &PendingCommand::finished, this, [=, this](const Response &response) {
if (response.response_code() == Response::RespOk) {
changePassword(oldPassword, newPassword);
} else {
QMessageBox::critical(this, tr("Error"),
tr("An error occurred while trying to update your user information."));
}
});
client->sendCommand(pend);
} else {
changePassword(oldPassword, newPassword);

View File

@@ -51,8 +51,7 @@ void UserListManager::setOwnUserInfo(const ServerInfo_User &userInfo)
void UserListManager::populateInitialOnlineUsers()
{
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
connect(pend, qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
this, &UserListManager::processListUsersResponse);
connect(pend, &PendingCommand::finished, this, &UserListManager::processListUsersResponse);
client->sendCommand(pend);
}