QTfrontend/gameuiconfig.cpp
changeset 9054 707e40076be6
parent 8924 13ac59499066
child 9055 45ebf126a5c2
equal deleted inserted replaced
9053:0bf55d656352 9054:707e40076be6
   519 void GameUIConfig::clearPasswordHash()
   519 void GameUIConfig::clearPasswordHash()
   520 {
   520 {
   521     setValue("net/passwordhash", QString());
   521     setValue("net/passwordhash", QString());
   522     setValue("net/passwordlength", 0);
   522     setValue("net/passwordlength", 0);
   523     setValue("net/savepassword", false); //changes the savepassword value to false in order to not let the user save an empty password in PAGE_SETUP
   523     setValue("net/savepassword", false); //changes the savepassword value to false in order to not let the user save an empty password in PAGE_SETUP
   524     reloadValues(); //reloads the values of PAGE_SETUP
   524     Form->ui.pageOptions->editNetPassword->setEnabled(false);
       
   525     Form->ui.pageOptions->editNetPassword->setText("");
   525 }
   526 }
   526 
   527 
   527 void GameUIConfig::setPasswordHash(const QString & passwordhash)
   528 void GameUIConfig::setPasswordHash(const QString & passwordhash)
   528 {
   529 {
   529     setValue("net/passwordhash", passwordhash);
   530     setValue("net/passwordhash", passwordhash);
   530     setValue("net/passwordlength", passwordhash.size()/4);
   531     if (passwordhash!=NULL && passwordhash.size() > 0)
   531     setNetPasswordLength(passwordhash.size()/4);  //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW
   532     {
       
   533     // WTF - the whole point of "password length" was to have the dots match what they typed.  This is totally pointless, and all hashes are the same length for a given hash so might as well hardcode it.
       
   534     // setValue("net/passwordlength", passwordhash.size()/4);
       
   535         setValue("net/passwordlength", 8);
       
   536 
       
   537     // More WTF
       
   538     //setNetPasswordLength(passwordhash.size()/4);  //the hash.size() is divided by 4 let PAGE_SETUP use a reasonable number of stars to display the PW
       
   539         setNetPasswordLength(8);
       
   540     }
       
   541     else
       
   542     {
       
   543         setValue("net/passwordlength", 0);
       
   544         setNetPasswordLength(0);
       
   545     }
   532 }
   546 }
   533 
   547 
   534 QString GameUIConfig::passwordHash()
   548 QString GameUIConfig::passwordHash()
   535 {
   549 {
   536     return value("net/passwordhash").toString();
   550     return value("net/passwordhash").toString();