mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -07:00
remove usages of qOverload
This commit is contained in:
parent
4c9e5676ac
commit
663cd65fca
6 changed files with 7 additions and 18 deletions
|
|
@ -39,10 +39,7 @@ TabAccount::TabAccount(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
|
||||||
connect(client, &AbstractClient::removeFromListEventReceived, this, &TabAccount::processRemoveFromListEvent);
|
connect(client, &AbstractClient::removeFromListEventReceived, this, &TabAccount::processRemoveFromListEvent);
|
||||||
|
|
||||||
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
|
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
|
||||||
connect(pend,
|
connect(pend, &PendingCommand::finished, this, &TabAccount::processListUsersResponse);
|
||||||
static_cast<void (PendingCommand::*)(const Response &, const CommandContainer &, const QVariant &)>(
|
|
||||||
&PendingCommand::finished),
|
|
||||||
this, &TabAccount::processListUsersResponse);
|
|
||||||
client->sendCommand(pend);
|
client->sendCommand(pend);
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout;
|
QVBoxLayout *vbox = new QVBoxLayout;
|
||||||
|
|
|
||||||
|
|
@ -170,9 +170,7 @@ void TabAdmin::actGrantReplayAccess()
|
||||||
cmd.set_moderator_name(client->getUserName().toStdString());
|
cmd.set_moderator_name(client->getUserName().toStdString());
|
||||||
|
|
||||||
auto *pend = client->prepareModeratorCommand(cmd);
|
auto *pend = client->prepareModeratorCommand(cmd);
|
||||||
connect(pend,
|
connect(pend, &PendingCommand::finished, this, &TabAdmin::grantReplayAccessProcessResponse);
|
||||||
QOverload<const Response &, const CommandContainer &, const QVariant &>::of(&PendingCommand::finished),
|
|
||||||
this, &TabAdmin::grantReplayAccessProcessResponse);
|
|
||||||
client->sendCommand(pend);
|
client->sendCommand(pend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -274,8 +274,7 @@ void GameSelector::actJoin()
|
||||||
}
|
}
|
||||||
|
|
||||||
PendingCommand *pend = r->prepareRoomCommand(cmd);
|
PendingCommand *pend = r->prepareRoomCommand(cmd);
|
||||||
connect(pend, qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
|
connect(pend, &PendingCommand::finished, this, &GameSelector::checkResponse);
|
||||||
this, &GameSelector::checkResponse);
|
|
||||||
r->sendRoomCommand(pend);
|
r->sendRoomCommand(pend);
|
||||||
|
|
||||||
disableButtons();
|
disableButtons();
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,7 @@ void ZoneViewZone::initializeCards(const QList<const ServerInfo_Card *> &cardLis
|
||||||
cmd.set_is_reversed(isReversed);
|
cmd.set_is_reversed(isReversed);
|
||||||
|
|
||||||
PendingCommand *pend = player->prepareGameCommand(cmd);
|
PendingCommand *pend = player->prepareGameCommand(cmd);
|
||||||
connect(pend,
|
connect(pend, &PendingCommand::finished, this, &ZoneViewZone::zoneDumpReceived);
|
||||||
qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
|
|
||||||
this, &ZoneViewZone::zoneDumpReceived);
|
|
||||||
player->sendGameCommand(pend);
|
player->sendGameCommand(pend);
|
||||||
} else {
|
} else {
|
||||||
const CardList &c = origZone->getCards();
|
const CardList &c = origZone->getCards();
|
||||||
|
|
|
||||||
|
|
@ -250,10 +250,8 @@ void UserInfoBox::actPassword()
|
||||||
cmd.set_user_name(client->getUserName().toStdString());
|
cmd.set_user_name(client->getUserName().toStdString());
|
||||||
|
|
||||||
PendingCommand *pend = client->prepareSessionCommand(cmd);
|
PendingCommand *pend = client->prepareSessionCommand(cmd);
|
||||||
connect(pend,
|
connect(pend, &PendingCommand::finished, this,
|
||||||
// we need qoverload here in order to select the right version of this function
|
[=, this](const Response &response, const CommandContainer &, const QVariant &) {
|
||||||
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) {
|
if (response.response_code() == Response::RespOk) {
|
||||||
changePassword(oldPassword, newPassword);
|
changePassword(oldPassword, newPassword);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,7 @@ void UserListManager::setOwnUserInfo(const ServerInfo_User &userInfo)
|
||||||
void UserListManager::populateInitialOnlineUsers()
|
void UserListManager::populateInitialOnlineUsers()
|
||||||
{
|
{
|
||||||
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
|
PendingCommand *pend = client->prepareSessionCommand(Command_ListUsers());
|
||||||
connect(pend, qOverload<const Response &, const CommandContainer &, const QVariant &>(&PendingCommand::finished),
|
connect(pend, &PendingCommand::finished, this, &UserListManager::processListUsersResponse);
|
||||||
this, &UserListManager::processListUsersResponse);
|
|
||||||
client->sendCommand(pend);
|
client->sendCommand(pend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue