Namespace sh::tools::accountsΒΆ

namespace sh::tools::accounts

Account and password storage.

See sh::tools::accounts::AccountsManager for more.

class AbstractAccountsProvider
#include <abstractaccountsprovider.h>

Abstract base class for accounts provider.

Implement this class (and register an instance of it) in order to add support for something like a password/account manager.

Subclassed by sh::tools::accounts::FallbackAccountsProvider, sh::tools::accounts::LibsecretAccountsProvider

Public Functions

AbstractAccountsProvider()
~AbstractAccountsProvider()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result) = 0

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account) = 0

Stores account infos.

class Account
#include <accountsmanager.h>

Account data (for accessing network drives).

Public Functions

Account() = default
Account(const Account &other) = default

Public Members

QString username
QString domain
QString server
int serverport = -1
QString path
QString protocol
QString authtype
QByteArray authinfo
class AccountsManager : public sh::base::Singleton
#include <accountsmanager.h>

Storage for account data (for accessing network drives).

Public Functions

QList<std::shared_ptr<Account>> findAccounts(std::shared_ptr<Account> pattern)

Finds account infos by a given pattern.

void storeAccount(std::shared_ptr<Account> account)

Stores account infos.

void registerProvider(std::shared_ptr<AbstractAccountsProvider> provider)

Registers a new accounts provider.

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Private Functions

AccountsManager()

Private Members

QList<std::shared_ptr<AbstractAccountsProvider>> accountsproviders
QMutex mutex
class FallbackAccountsProvider : public sh::tools::accounts::AbstractAccountsProvider
#include <fallbackaccountsprovider.h>

A fallback accounts provider which at least stores user names (i.e. no passwords) locally on disk.

Public Functions

FallbackAccountsProvider()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result)

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account)

Stores account infos.

Public Static Functions

void doInitialize()
void doShutdown()

Private Functions

QList<std::shared_ptr<Account>> _find_rem_account_helper(std::shared_ptr<Account> pattern, bool remove)

Private Members

QString accountsdir
class LibsecretAccountsProvider : public sh::tools::accounts::AbstractAccountsProvider
#include <libsecretaccountsprovider.h>

An accounts provider based on gnome-keyring.

Public Functions

LibsecretAccountsProvider()
void findAccounts(std::shared_ptr<Account> pattern, QList<std::shared_ptr<Account>> &result)

Finds account info by a given pattern.

bool storeAccount(std::shared_ptr<Account> account)

Stores account infos.

Public Static Functions

void doInitialize()
void doShutdown()

Private Members

QByteArray sauthtype = QString("authtype").toUtf8()
QByteArray sdomain = QString("domain").toUtf8()
QByteArray spath = QString("object").toUtf8()
QByteArray sprotocol = QString("protocol").toUtf8()
QByteArray sserver = QString("server").toUtf8()
QByteArray sserverport = QString("port").toUtf8()
QByteArray susername = QString("user").toUtf8()