mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
deprecate the gender property from the protocol entirely (#4496)
* deprecate the gender property from the protocol entirely * use obsolete instead of deprecated * add the database migration * update internal database version as well
This commit is contained in:
parent
86881bbbc3
commit
07e6aadbbe
24 changed files with 25 additions and 170 deletions
|
|
@ -88,7 +88,6 @@ protected slots:
|
|||
protected:
|
||||
QMap<int, PendingCommand *> pendingCommands;
|
||||
QString userName, password, email, country, realName, token;
|
||||
int gender;
|
||||
void setStatus(ClientStatus _status);
|
||||
int getNewCmdId()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ public:
|
|||
{
|
||||
return emailEdit->text();
|
||||
}
|
||||
int getGender() const
|
||||
{
|
||||
return -1;
|
||||
} // This will return GenderUnknown for protocol purposes.
|
||||
QString getCountry() const
|
||||
{
|
||||
return countryEdit->currentIndex() == 0 ? "" : countryEdit->currentText();
|
||||
|
|
|
|||
|
|
@ -34,10 +34,6 @@ public:
|
|||
{
|
||||
return emailEdit->text();
|
||||
}
|
||||
int getGender() const
|
||||
{
|
||||
return -1;
|
||||
} // This will return GenderUnknown for the protocol.
|
||||
QString getCountry() const
|
||||
{
|
||||
return countryEdit->currentIndex() == 0 ? "" : countryEdit->currentText();
|
||||
|
|
|
|||
|
|
@ -78,25 +78,6 @@ QPixmap PingPixmapGenerator::generatePixmap(int size, int value, int max)
|
|||
|
||||
QMap<int, QPixmap> PingPixmapGenerator::pmCache;
|
||||
|
||||
QPixmap GenderPixmapGenerator::generatePixmap(int height)
|
||||
{
|
||||
ServerInfo_User::Gender gender = ServerInfo_User::GenderUnknown;
|
||||
|
||||
int key = gender * 100000 + height;
|
||||
if (pmCache.contains(key))
|
||||
return pmCache.value(key);
|
||||
|
||||
QString genderStr;
|
||||
genderStr = "unknown";
|
||||
|
||||
QPixmap pixmap =
|
||||
QPixmap("theme:genders/" + genderStr).scaled(height, height, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
pmCache.insert(key, pixmap);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QMap<int, QPixmap> GenderPixmapGenerator::pmCache;
|
||||
|
||||
QPixmap CountryPixmapGenerator::generatePixmap(int height, const QString &countryCode)
|
||||
{
|
||||
if (countryCode.size() != 2)
|
||||
|
|
|
|||
|
|
@ -45,19 +45,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class GenderPixmapGenerator
|
||||
{
|
||||
private:
|
||||
static QMap<int, QPixmap> pmCache;
|
||||
|
||||
public:
|
||||
static QPixmap generatePixmap(int height);
|
||||
static void clear()
|
||||
{
|
||||
pmCache.clear();
|
||||
}
|
||||
};
|
||||
|
||||
class CountryPixmapGenerator
|
||||
{
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ void RemoteClient::processServerIdentificationEvent(const Event_ServerIdentifica
|
|||
cmdRegister.set_user_name(userName.toStdString());
|
||||
cmdRegister.set_password(password.toStdString());
|
||||
cmdRegister.set_email(email.toStdString());
|
||||
cmdRegister.set_gender((ServerInfo_User_Gender)gender);
|
||||
cmdRegister.set_country(country.toStdString());
|
||||
cmdRegister.set_real_name(realName.toStdString());
|
||||
cmdRegister.set_clientid(getSrvClientID(lastHostname).toStdString());
|
||||
|
|
@ -449,7 +448,6 @@ void RemoteClient::doRegisterToServer(const QString &hostname,
|
|||
const QString &_userName,
|
||||
const QString &_password,
|
||||
const QString &_email,
|
||||
const int _gender,
|
||||
const QString &_country,
|
||||
const QString &_realname)
|
||||
{
|
||||
|
|
@ -458,7 +456,6 @@ void RemoteClient::doRegisterToServer(const QString &hostname,
|
|||
userName = _userName;
|
||||
password = _password;
|
||||
email = _email;
|
||||
gender = _gender;
|
||||
country = _country;
|
||||
realName = _realname;
|
||||
lastHostname = hostname;
|
||||
|
|
@ -539,11 +536,10 @@ void RemoteClient::registerToServer(const QString &hostname,
|
|||
const QString &_userName,
|
||||
const QString &_password,
|
||||
const QString &_email,
|
||||
const int _gender,
|
||||
const QString &_country,
|
||||
const QString &_realname)
|
||||
{
|
||||
emit sigRegisterToServer(hostname, port, _userName, _password, _email, _gender, _country, _realname);
|
||||
emit sigRegisterToServer(hostname, port, _userName, _password, _email, _country, _realname);
|
||||
}
|
||||
|
||||
void RemoteClient::activateToServer(const QString &_token)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ signals:
|
|||
const QString &_userName,
|
||||
const QString &_password,
|
||||
const QString &_email,
|
||||
int _gender,
|
||||
const QString &_country,
|
||||
const QString &_realname);
|
||||
void sigActivateToServer(const QString &_token);
|
||||
|
|
@ -67,7 +66,6 @@ private slots:
|
|||
const QString &_userName,
|
||||
const QString &_password,
|
||||
const QString &_email,
|
||||
int _gender,
|
||||
const QString &_country,
|
||||
const QString &_realname);
|
||||
void doRequestPasswordSalt();
|
||||
|
|
@ -130,7 +128,6 @@ public:
|
|||
const QString &_userName,
|
||||
const QString &_password,
|
||||
const QString &_email,
|
||||
int _gender,
|
||||
const QString &_country,
|
||||
const QString &_realname);
|
||||
void activateToServer(const QString &_token);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ void UserInfoBox::actEditInternal(const Response &r)
|
|||
Command_AccountEdit cmd;
|
||||
cmd.set_real_name(dlg.getRealName().toStdString());
|
||||
cmd.set_email(dlg.getEmail().toStdString());
|
||||
cmd.set_gender((ServerInfo_User_Gender)dlg.getGender());
|
||||
cmd.set_country(dlg.getCountry().toStdString());
|
||||
|
||||
PendingCommand *pend = client->prepareSessionCommand(cmd);
|
||||
|
|
|
|||
|
|
@ -201,8 +201,7 @@ void MainWindow::actRegister()
|
|||
DlgRegister dlg(this);
|
||||
if (dlg.exec()) {
|
||||
client->registerToServer(dlg.getHost(), static_cast<unsigned int>(dlg.getPort()), dlg.getPlayerName(),
|
||||
dlg.getPassword(), dlg.getEmail(), dlg.getGender(), dlg.getCountry(),
|
||||
dlg.getRealName());
|
||||
dlg.getPassword(), dlg.getEmail(), dlg.getCountry(), dlg.getRealName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue