# HG changeset patch # User Ondrej Skopek # Date 1355507365 -3600 # Node ID b236e3afed0d74d58e898cb9fc787d9c8a0dd1fd # Parent 455da122c0adfe5cdc731f3769dd4050299b6440 Reverted password loading in PAGE_SETUP, changed the value of passwordlength to save, added clearing of hashes after a 'Wrong password' RetryDialog diff -r 455da122c0ad -r b236e3afed0d QTfrontend/gameuiconfig.cpp --- a/QTfrontend/gameuiconfig.cpp Thu Dec 13 20:34:44 2012 +0100 +++ b/QTfrontend/gameuiconfig.cpp Fri Dec 14 18:49:25 2012 +0100 @@ -233,13 +233,11 @@ setValue("audio/volume", Form->ui.pageOptions->volumeBox->value()); setValue("net/nick", netNick()); - if ((netPasswordLength()==0)) { - setValue("net/passwordhash", ""); - setValue("net/passwordlength", 0); + if (netPasswordIsValid() && Form->ui.pageOptions->CBSavePassword->isChecked()) { + setPasswordHash(netPasswordHash()); } - else if (netPasswordIsValid() && Form->ui.pageOptions->CBSavePassword->isChecked()) { - setValue("net/passwordhash", ""); - setValue("net/passwordlength", 0); + else if(!Form->ui.pageOptions->CBSavePassword->isChecked()) { + clearPasswordHash(); } setValue("net/savepassword", Form->ui.pageOptions->CBSavePassword->isChecked()); @@ -490,8 +488,8 @@ void GameUIConfig::setPasswordHash(const QString & passwordhash) { setValue("net/passwordhash", passwordhash); - setValue("net/passwordlength", passwordhash.size()); - setNetPasswordLength(passwordhash.size()); + setValue("net/passwordlength", passwordhash.size()/4); + setNetPasswordLength(passwordhash.size()/4); //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW } QString GameUIConfig::passwordHash() diff -r 455da122c0ad -r b236e3afed0d QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Dec 13 20:34:44 2012 +0100 +++ b/QTfrontend/hwform.cpp Fri Dec 14 18:49:25 2012 +0100 @@ -1127,6 +1127,8 @@ bool retry = RetryDialog(tr("Hedgewars - Wrong password"), tr("You entered a wrong password.")); GoBack(); + config->clearPasswordHash(); + config->clearTempHash(); if (retry) { NetConnectOfficialServer(); }