mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kutils: new KPasswdStore::stores() method to get all current stores
to be used by the KCM Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
581e3037cf
commit
c311f7032f
2 changed files with 13 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "kglobal.h"
|
||||
#include "kstandarddirs.h"
|
||||
#include "klockfile.h"
|
||||
#include "ksettings.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDBusInterface>
|
||||
|
@ -146,6 +147,13 @@ bool KPasswdStore::storePasswd(const QByteArray &key, const QString &passwd, con
|
|||
return result.value();
|
||||
}
|
||||
|
||||
QStringList KPasswdStore::stores()
|
||||
{
|
||||
KSettings passwdstore(KStandardDirs::locateLocal("data", "kpasswdstore.ini"), KSettings::SimpleConfig);
|
||||
passwdstore.beginGroup("KPasswdStore");
|
||||
return passwdstore.groupKeys();
|
||||
}
|
||||
|
||||
QByteArray KPasswdStore::makeKey(const QString &string)
|
||||
{
|
||||
return QCryptographicHash::hash(string.toUtf8(), QCryptographicHash::KAT).toHex();
|
||||
|
|
|
@ -107,6 +107,11 @@ public:
|
|||
*/
|
||||
static QByteArray makeKey(const QString &string);
|
||||
|
||||
/*!
|
||||
@brief Returns all current password stores
|
||||
*/
|
||||
static QStringList stores();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(KPasswdStore);
|
||||
KPasswdStorePrivate *d;
|
||||
|
|
Loading…
Add table
Reference in a new issue