Use Keyring in the login dialog
This commit is contained in:
@ -72,6 +72,14 @@ public:
|
||||
*/
|
||||
virtual QStringList getStoredAccounts(QString service) = 0;
|
||||
|
||||
/**
|
||||
* @brief Remove the specified account from storage
|
||||
* @param service the service name
|
||||
* @param username the account name
|
||||
* @return
|
||||
*/
|
||||
virtual void removeStoredAccount(QString service, QString username) = 0;
|
||||
|
||||
protected:
|
||||
/// fall back to StubKeyring if false
|
||||
virtual bool isValid() { return false; }
|
||||
|
@ -90,6 +90,12 @@ QStringList StubKeyring::getStoredAccounts(QString service)
|
||||
return out;
|
||||
}
|
||||
|
||||
void StubKeyring::removeStoredAccount ( QString service, QString username )
|
||||
{
|
||||
QString key = generateKey(service, username);
|
||||
m_settings.remove(key);
|
||||
}
|
||||
|
||||
StubKeyring::StubKeyring() :
|
||||
m_settings(QSettings::UserScope, "Orochimarufan", "Keyring")
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
virtual QString getPassword(QString service, QString username);
|
||||
virtual bool hasPassword(QString service, QString username);
|
||||
virtual QStringList getStoredAccounts(QString service);
|
||||
|
||||
virtual void removeStoredAccount(QString service, QString username);
|
||||
private:
|
||||
friend class Keyring;
|
||||
explicit StubKeyring();
|
||||
|
Reference in New Issue
Block a user