Change wxSecretStore API to allow retrieving the username
The old API didn't make any sense for the most common case when both the user name and password need to be stored, as it required providing the user name as input, which couldn't work (but somehow this went unnoticed for more than a year...). Fix this by returning the username, and not only the password, from Load() instead of taking it as parameter and removing this parameter from Delete() as well. Also improve the documentation, notably include a simple example of using this class. Notice that this is a backwards-incompatible change, but the old API was really badly broken and didn't appear in 3.1.0 yet, so the breakage is both unavoidable and, hopefully, shouldn't affect much code. Nevertheless, a special wxHAS_SECRETSTORE_LOAD_USERNAME symbol is added to allow testing for it if necessary.
This commit is contained in:
@@ -79,14 +79,14 @@ class wxSecretStoreImpl : public wxRefCounter
|
||||
{
|
||||
public:
|
||||
virtual bool Save(const wxString& service,
|
||||
const wxString& user,
|
||||
const wxSecretValueImpl& secret,
|
||||
const wxString& username,
|
||||
const wxSecretValueImpl& password,
|
||||
wxString& errmsg) = 0;
|
||||
virtual wxSecretValueImpl* Load(const wxString& service,
|
||||
const wxString& user,
|
||||
wxString& errmsg) const = 0;
|
||||
virtual bool Load(const wxString& service,
|
||||
wxString* username,
|
||||
wxSecretValueImpl** password,
|
||||
wxString& errmsg) const = 0;
|
||||
virtual bool Delete(const wxString& service,
|
||||
const wxString& user,
|
||||
wxString& errmsg) = 0;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user