small fix and an explanation of the password remembering function...
...in the preferences
This commit is contained in:
parent
d4ae8a322b
commit
44a43e7068
2 changed files with 9 additions and 5 deletions
|
@ -371,11 +371,7 @@ bool remember_password()
|
|||
void set_remember_password(bool remember)
|
||||
{
|
||||
preferences::set("remember_password", remember ? "yes" : "no");
|
||||
|
||||
// Clear the password
|
||||
if(!remember) {
|
||||
preferences::set("password", "");
|
||||
}
|
||||
preferences::set("password", remember ? prv::password : "");
|
||||
}
|
||||
|
||||
bool turn_dialog()
|
||||
|
|
|
@ -73,6 +73,14 @@ namespace preferences {
|
|||
std::string login();
|
||||
void set_login(const std::string& username);
|
||||
|
||||
// If password remembering is turned off use
|
||||
// prv::password instead. This way we will not
|
||||
// have to worry about whether to remember the
|
||||
// password or not anywhere else in the code.
|
||||
//
|
||||
// It is put into a separate namespace to make clear
|
||||
// it is "private" and not supposed to be edit outside
|
||||
// of the preferences functions.
|
||||
namespace prv {
|
||||
extern std::string password;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue