KWallet
kwallet.cpp
149 KSecretsService::CreateCollectionItemJob *createItemJob = secretsCollection->createItem(key, attrs, secret);
152 qCDebug(KWALLET_API_LOG) << "Cannot execute CreateCollectionItemJob : " << createItemJob->errorString();
170 KSecretsService::SearchCollectionItemsJob *searchItemsJob = secretsCollection->searchItems(attrs);
177 const QString pattern = QRegularExpression::wildcardToRegularExpression(key).replace(QLatin1String("[^/]"), QLatin1String("."));
190 qCDebug(KWALLET_API_LOG) << "Cannot execute ReadItemPropertyJob " << readLabelJob->errorString();
194 qCDebug(KWALLET_API_LOG) << "Cannot execute KSecretsService::SearchCollectionItemsJob " << searchItemsJob->errorString();
206 KSecretsService::SearchCollectionItemsJob *searchItemsJob = secretsCollection->searchItems(attrs);
217 qCDebug(KWALLET_API_LOG) << "Cannot execute ReadItemPropertyJob " << readLabelJob->errorString();
221 qCDebug(KWALLET_API_LOG) << "Cannot execute KSecretsService::SearchCollectionItemsJob " << searchItemsJob->errorString();
266 QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QString::fromLatin1(s_kwalletdServiceName),
274 connect(&walletLauncher()->getInterface(), &org::kde::KWallet::walletClosedId, this, &KWallet::Wallet::slotWalletClosed);
275 connect(&walletLauncher()->getInterface(), &org::kde::KWallet::folderListUpdated, this, &KWallet::Wallet::slotFolderListUpdated);
276 connect(&walletLauncher()->getInterface(), &org::kde::KWallet::folderUpdated, this, &KWallet::Wallet::slotFolderUpdated);
277 connect(&walletLauncher()->getInterface(), &org::kde::KWallet::applicationDisconnected, this, &KWallet::Wallet::slotApplicationDisconnected);
357 qCDebug(KWALLET_API_LOG) << "Cannot execute change password job: " << changePwdJob->errorString();
387 KSecretsService::Collection *coll = KSecretsService::Collection::findCollection(name, KSecretsService::Collection::OpenOnly);
443 KSecretsService::Collection *coll = KSecretsService::Collection::findCollection(name, KSecretsService::Collection::OpenOnly);
483 wallet->d->secretsCollection = KSecretsService::Collection::findCollection(name, KSecretsService::Collection::CreateCollection, QVariantMap(), w);
484 connect(wallet->d->secretsCollection, SIGNAL(statusChanged(int)), wallet, SLOT(slotCollectionStatusChanged(int)));
485 connect(wallet->d->secretsCollection, SIGNAL(deleted()), wallet, SLOT(slotCollectionDeleted()));
488 // TODO: not sure what to do with in this case; however, all other KSecretsService API methods are already
498 connect(&walletLauncher()->getInterface(), &org::kde::KWallet::walletAsyncOpened, wallet, &KWallet::Wallet::walletAsyncOpened);
659 qCDebug(KWALLET_API_LOG) << "Cannot execute KSecretsService::CollectionLockJob : " << lockJob->errorString();
710 KSecretsService::ChangeCollectionPasswordJob *changePwdJob = d->secretsCollection->changePassword();
712 qCDebug(KWALLET_API_LOG) << "Cannot execute ChangeCollectionPasswordJob : " << changePwdJob->errorString();
755 attrs[KSS_ATTR_ENTRYFOLDER] = ""; // search for items having this attribute no matter what value it has
756 KSecretsService::SearchCollectionItemsJob *searchJob = d->secretsCollection->searchItems(attrs);
763 KSecretsService::StringStringMap attrs = readAttrsJob->propertyValue().value<KSecretsService::StringStringMap>();
773 qCDebug(KWALLET_API_LOG) << "Cannot execute ReadCollectionItemsJob : " << searchJob->errorString();
801 KSecretsService::SearchCollectionItemsJob *readItemsJob = d->secretsCollection->searchItems(attrs);
822 QDBusReply<QStringList> r = walletLauncher()->getInterface().entryList(d->handle, d->folder, appid());
934 KSecretsService::SearchCollectionItemsJob *searchJob = d->secretsCollection->searchItems(attrs);
949 qCDebug(KWALLET_API_LOG) << "Cannot execute KSecretsService::SearchCollectionItemsJob : " << searchJob->errorString();
980 QExplicitlySharedDataPointer<KSecretsService::SecretItem> Wallet::WalletPrivate::findItem(const QString &key) const
995 qCDebug(KWALLET_API_LOG) << "Cannot exec KSecretsService::SearchCollectionItemsJob : " << searchJob->errorString();
1020 bool Wallet::WalletPrivate::readSecret(const QString &key, KSecretsService::Secret &value) const
1050 QDBusReply<QByteArray> r = walletLauncher()->getInterface().readEntry(d->handle, d->folder, key, appid());
1068 bool operator()(Wallet::WalletPrivate *, const QString &label, KSecretsService::SecretItem *item)
1076 qCDebug(KWALLET_API_LOG) << "Cannot execute GetSecretItemSecretJob " << readSecretJob->errorString();
1103 QDBusReply<QVariantMap> r = walletLauncher()->getInterface().readEntryList(d->handle, d->folder, key, appid());
1142 QDBusReply<QVariantMap> reply = walletLauncher()->getInterface().entriesList(d->handle, d->folder, appid());
1185 QDBusReply<int> r = walletLauncher()->getInterface().renameEntry(d->handle, d->folder, oldName, newName, appid());
1217 QDBusReply<QByteArray> r = walletLauncher()->getInterface().readMap(d->handle, d->folder, key, appid());
1272 QDBusReply<QVariantMap> r = walletLauncher()->getInterface().readMapList(d->handle, d->folder, key, appid());
1316 QDBusReply<QVariantMap> reply = walletLauncher()->getInterface().mapList(d->handle, d->folder, appid());
1352 QDBusReply<QString> r = walletLauncher()->getInterface().readPassword(d->handle, d->folder, key, appid());
1403 QDBusReply<QVariantMap> r = walletLauncher()->getInterface().readPasswordList(d->handle, d->folder, key, appid());
1440 QDBusReply<QVariantMap> reply = walletLauncher()->getInterface().passwordList(d->handle, d->folder, appid());
1470 QDBusReply<int> r = walletLauncher()->getInterface().writeEntry(d->handle, d->folder, key, value, int(entryType), appid());
1494 QDBusReply<int> r = walletLauncher()->getInterface().writeEntry(d->handle, d->folder, key, value, appid());
1523 QDBusReply<int> r = walletLauncher()->getInterface().writeMap(d->handle, d->folder, key, mapData, appid());
1547 QDBusReply<int> r = walletLauncher()->getInterface().writePassword(d->handle, d->folder, key, value, appid());
1570 QDBusReply<bool> r = walletLauncher()->getInterface().hasEntry(d->handle, d->folder, key, appid());
1602 QDBusReply<int> r = walletLauncher()->getInterface().removeEntry(d->handle, d->folder, key, appid());
1623 KSecretsService::StringStringMap attrs = readAttrsJob->propertyValue().value<KSecretsService::StringStringMap>();
1630 qCDebug(KWALLET_API_LOG) << KSS_ATTR_WALLETTYPE << " attribute holds non int value " << attrs[KSS_ATTR_WALLETTYPE];
1634 qCDebug(KWALLET_API_LOG) << "Cannot execute GetSecretItemSecretJob " << readAttrsJob->errorString();
1643 QDBusReply<int> r = walletLauncher()->getInterface().entryType(d->handle, d->folder, key, appid());
1745 qCDebug(KWALLET_API_LOG) << "WARNING: changing semantics of folderDoesNotExist with KSS: will prompt for the password";
1774 qCDebug(KWALLET_API_LOG) << "WARNING: changing semantics of keyDoesNotExist with KSS: will prompt for the password";
1805 , m_cgroup(KSharedConfig::openConfig(QStringLiteral("kwalletrc"), KConfig::NoGlobals)->group("Wallet"))
1820 new org::kde::KWallet(QString::fromLatin1(s_kwalletdServiceName), QStringLiteral("/modules/kwalletd5"), QDBusConnection::sessionBus());
void append(const T &value)
QString readEntry(const char *key, const char *aDefault=nullptr) const
static Wallet * openWallet(const QString &name, WId w, OpenType ot=Synchronous)
Open the wallet name.
Definition: kwallet.cpp:468
QString wildcardToRegularExpression(const QString &pattern)
void walletOpened(bool success)
Emitted when a wallet is opened in asynchronous mode.
virtual int readMap(const QString &key, QMap< QString, QString > &value)
Read the map entry key from the current folder.
Definition: kwallet.cpp:1197
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
ReadOnly
virtual bool removeFolder(const QString &f)
Remove the folder f and all its entries from the wallet.
Definition: kwallet.cpp:926
static bool isUsingKSecretsService()
Determine if the KWallet API is using the KSecretsService infrastructure This can ben changed in syst...
Definition: kwallet.cpp:77
QString pattern(Mode mode=Reading)
Q_EMITQ_EMIT
virtual bool hasEntry(const QString &key)
Determine if the current folder has they entry key.
Definition: kwallet.cpp:1558
int readPasswordList(const QString &key, QMap< QString, QString > &value)
Read the password entry key from the current folder.
Definition: kwallet.cpp:1385
singleShot
bool isValid() const const
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
virtual QStringList entryList()
Return the list of keys of all entries in this folder.
Definition: kwallet.cpp:794
QDBusReply< bool > isServiceRegistered(const QString &serviceName) const const
virtual EntryType entryType(const QString &key)
Determine the type of the entry key in this folder.
Definition: kwallet.cpp:1613
virtual const QString & walletName() const
The name of the current wallet.
Definition: kwallet.cpp:684
QMap< QString, QByteArray > entriesList(bool *ok) const
Get a list of all the entries in the current folder.
Definition: kwallet.cpp:1121
void folderUpdated(const QString &folder)
Emitted when a folder in this wallet is updated.
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
void serviceUnregistered(const QString &serviceName)
QMap< QString, QMap< QString, QString > > mapList(bool *ok) const
Get a list of all the maps in the current folder.
Definition: kwallet.cpp:1295
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static const QString PasswordFolder()
The standardized name of the password folder.
Definition: kwallet.cpp:113
virtual int readPassword(const QString &key, QString &value)
Read the password entry key from the current folder.
Definition: kwallet.cpp:1339
Q_GLOBAL_STATIC(Internal::StaticControl, s_instance) class ControlPrivate
int readEntryList(const QString &key, QMap< QString, QByteArray > &value)
Read the entries matching key from the current folder.
Definition: kwallet.cpp:1085
static void changePassword(const QString &name, WId w)
Request to the wallet service to change the password of the wallet name.
Definition: kwallet.cpp:344
QMap::iterator insert(const Key &key, const T &value)
virtual int readEntry(const QString &key, QByteArray &value)
Read the entry key from the current folder.
Definition: kwallet.cpp:1037
QDBusReply< void > startService(const QString &name)
const QDBusError & error()
QDBusConnection sessionBus()
virtual int removeEntry(const QString &key)
Remove the entry key from the current folder.
Definition: kwallet.cpp:1582
virtual int writePassword(const QString &key, const QString &value)
Write key = value as a password to the current folder.
Definition: kwallet.cpp:1534
QMap< QString, QString > passwordList(bool *ok) const
Get a list of all the passwords in the current folder, which can be used to populate a list view in a...
Definition: kwallet.cpp:1420
static bool disconnectApplication(const QString &wallet, const QString &app)
Disconnect the application app from wallet.
Definition: kwallet.cpp:583
bool isEmpty() const const
virtual QStringList folderList()
Obtain the list of all folders contained in the wallet.
Definition: kwallet.cpp:748
static QStringList users(const QString &wallet)
List the applications that are using the wallet wallet.
Definition: kwallet.cpp:608
static int closeWallet(const QString &name, bool force)
Close the wallet name.
Definition: kwallet.cpp:414
void insert(int i, const T &value)
QDBusConnectionInterface * interface() const const
QString & replace(int position, int n, QChar after)
QString label(StandardShortcut id)
virtual bool hasFolder(const QString &f)
Determine if the folder f exists in the wallet.
Definition: kwallet.cpp:834
bool isEmpty() const const
static const QString LocalWallet()
The name of the wallet used to store local passwords.
Definition: kwallet.cpp:82
virtual int writeEntry(const QString &key, const QByteArray &value, EntryType entryType)
Write key = value as a binary entry to the current folder.
Definition: kwallet.cpp:1457
virtual bool isOpen() const
Determine if the current wallet is open, and is a valid wallet handle.
Definition: kwallet.cpp:689
int readMapList(const QString &key, QMap< QString, QMap< QString, QString >> &value)
Read the map entry key from the current folder.
Definition: kwallet.cpp:1254
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QString & insert(int position, QChar ch)
QString fromLatin1(const char *str, int size)
QString name(StandardShortcut id)
virtual bool setFolder(const QString &f)
Set the current working folder to f.
Definition: kwallet.cpp:892
static const QString FormDataFolder()
The standardized name of the form data folder.
Definition: kwallet.cpp:118
virtual void requestChangePassword(WId w)
Request to the wallet service to change the password of the current wallet.
Definition: kwallet.cpp:702
static bool folderDoesNotExist(const QString &wallet, const QString &folder)
Determine if a folder does not exist in a wallet.
Definition: kwallet.cpp:1741
virtual int writeMap(const QString &key, const QMap< QString, QString > &value)
Write key = value as a map to the current folder.
Definition: kwallet.cpp:1505
virtual QString errorString() const
int error() const
static void allowExternalProcessWindowActivation(int pid=-1)
virtual int sync()
This syncs the wallet file on disk with what is in memory.
Definition: kwallet.cpp:632
void folderListUpdated()
Emitted when the folder list is changed in this wallet.
static const QString NetworkWallet()
The name of the wallet used to store network passwords.
Definition: kwallet.cpp:101
virtual const QString & currentFolder() const
Determine the current working folder in the wallet.
Definition: kwallet.cpp:974
bool exec()
WatchForUnregistration
virtual int renameEntry(const QString &oldName, const QString &newName)
Rename the entry oldName to newName.
Definition: kwallet.cpp:1160
QDBusReply::Type value() const const
static bool keyDoesNotExist(const QString &wallet, const QString &folder, const QString &key)
Determine if an entry in a folder does not exist in a wallet.
Definition: kwallet.cpp:1770
virtual void virtual_hook(int id, void *data)
Definition: kwallet.cpp:1798
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jul 4 2022 04:05:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jul 4 2022 04:05:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.