mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
delete overloaded signal in PendingCommand (#5477)
* 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:
parent
3a740f0bde
commit
2d02955f8b
11 changed files with 21 additions and 39 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue