mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-26 08:15:32 -04:00
FdoSecrets: code formatting
This commit is contained in:
parent
a651d7049d
commit
7f85eb77aa
8 changed files with 30 additions and 18 deletions
|
@ -415,7 +415,8 @@ namespace FdoSecrets
|
||||||
|
|
||||||
emit aliasAboutToAdd(alias);
|
emit aliasAboutToAdd(alias);
|
||||||
|
|
||||||
bool ok = registerWithPath(QStringLiteral(DBUS_PATH_TEMPLATE_ALIAS).arg(p()->objectPath().path(), alias), false);
|
bool ok =
|
||||||
|
registerWithPath(QStringLiteral(DBUS_PATH_TEMPLATE_ALIAS).arg(p()->objectPath().path(), alias), false);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
m_aliases.insert(alias);
|
m_aliases.insert(alias);
|
||||||
emit aliasAdded(alias);
|
emit aliasAdded(alias);
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit Collection(Service* parent, DatabaseWidget* backend);
|
explicit Collection(Service* parent, DatabaseWidget* backend);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a new instance of `Collection`
|
* @brief Create a new instance of `Collection`
|
||||||
|
|
|
@ -43,6 +43,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit Item(Collection* parent, Entry* backend);
|
explicit Item(Collection* parent, Entry* backend);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a new instance of `Item`.
|
* @brief Create a new instance of `Item`.
|
||||||
|
|
|
@ -41,7 +41,8 @@ namespace FdoSecrets
|
||||||
|
|
||||||
bool PromptBase::registerSelf()
|
bool PromptBase::registerSelf()
|
||||||
{
|
{
|
||||||
auto path = QStringLiteral(DBUS_PATH_TEMPLATE_PROMPT).arg(p()->objectPath().path(), Tools::uuidToHex(QUuid::createUuid()));
|
auto path = QStringLiteral(DBUS_PATH_TEMPLATE_PROMPT)
|
||||||
|
.arg(p()->objectPath().path(), Tools::uuidToHex(QUuid::createUuid()));
|
||||||
bool ok = registerWithPath(path);
|
bool ok = registerWithPath(path);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
service()->plugin()->emitError(tr("Failed to register item on DBus at path '%1'").arg(path));
|
service()->plugin()->emitError(tr("Failed to register item on DBus at path '%1'").arg(path));
|
||||||
|
@ -213,7 +214,8 @@ namespace FdoSecrets
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
DBusReturn<UnlockCollectionsPrompt*> UnlockCollectionsPrompt::Create(Service* parent, const QList<Collection*>& coll)
|
DBusReturn<UnlockCollectionsPrompt*> UnlockCollectionsPrompt::Create(Service* parent,
|
||||||
|
const QList<Collection*>& coll)
|
||||||
{
|
{
|
||||||
QScopedPointer<UnlockCollectionsPrompt> res{new UnlockCollectionsPrompt(parent, coll)};
|
QScopedPointer<UnlockCollectionsPrompt> res{new UnlockCollectionsPrompt(parent, coll)};
|
||||||
if (!res->registerSelf()) {
|
if (!res->registerSelf()) {
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit DeleteCollectionPrompt(Service* parent, Collection* coll);
|
explicit DeleteCollectionPrompt(Service* parent, Collection* coll);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DBusReturn<DeleteCollectionPrompt*> Create(Service* parent, Collection* coll);
|
static DBusReturn<DeleteCollectionPrompt*> Create(Service* parent, Collection* coll);
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit CreateCollectionPrompt(Service* parent);
|
explicit CreateCollectionPrompt(Service* parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DBusReturn<CreateCollectionPrompt*> Create(Service* parent);
|
static DBusReturn<CreateCollectionPrompt*> Create(Service* parent);
|
||||||
|
|
||||||
|
@ -87,6 +89,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit LockCollectionsPrompt(Service* parent, const QList<Collection*>& colls);
|
explicit LockCollectionsPrompt(Service* parent, const QList<Collection*>& colls);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DBusReturn<LockCollectionsPrompt*> Create(Service* parent, const QList<Collection*>& colls);
|
static DBusReturn<LockCollectionsPrompt*> Create(Service* parent, const QList<Collection*>& colls);
|
||||||
|
|
||||||
|
@ -103,6 +106,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit UnlockCollectionsPrompt(Service* parent, const QList<Collection*>& coll);
|
explicit UnlockCollectionsPrompt(Service* parent, const QList<Collection*>& coll);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DBusReturn<UnlockCollectionsPrompt*> Create(Service* parent, const QList<Collection*>& coll);
|
static DBusReturn<UnlockCollectionsPrompt*> Create(Service* parent, const QList<Collection*>& coll);
|
||||||
|
|
||||||
|
@ -124,6 +128,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit DeleteItemPrompt(Service* parent, Item* item);
|
explicit DeleteItemPrompt(Service* parent, Item* item);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static DBusReturn<DeleteItemPrompt*> Create(Service* parent, Item* item);
|
static DBusReturn<DeleteItemPrompt*> Create(Service* parent, Item* item);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,8 @@ namespace FdoSecrets
|
||||||
bool Service::initialize()
|
bool Service::initialize()
|
||||||
{
|
{
|
||||||
if (!QDBusConnection::sessionBus().registerService(QStringLiteral(DBUS_SERVICE_SECRET))) {
|
if (!QDBusConnection::sessionBus().registerService(QStringLiteral(DBUS_SERVICE_SECRET))) {
|
||||||
plugin()->emitError(tr("Failed to register DBus service at %1.<br/>").arg(QLatin1String(DBUS_SERVICE_SECRET))
|
plugin()->emitError(
|
||||||
|
tr("Failed to register DBus service at %1.<br/>").arg(QLatin1String(DBUS_SERVICE_SECRET))
|
||||||
+ m_plugin->reportExistingService());
|
+ m_plugin->reportExistingService());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -80,10 +81,8 @@ namespace FdoSecrets
|
||||||
|
|
||||||
// Connect to service unregistered signal
|
// Connect to service unregistered signal
|
||||||
m_serviceWatcher.reset(new QDBusServiceWatcher());
|
m_serviceWatcher.reset(new QDBusServiceWatcher());
|
||||||
connect(m_serviceWatcher.get(),
|
connect(
|
||||||
&QDBusServiceWatcher::serviceUnregistered,
|
m_serviceWatcher.get(), &QDBusServiceWatcher::serviceUnregistered, this, &Service::dbusServiceUnregistered);
|
||||||
this,
|
|
||||||
&Service::dbusServiceUnregistered);
|
|
||||||
|
|
||||||
m_serviceWatcher->setConnection(QDBusConnection::sessionBus());
|
m_serviceWatcher->setConnection(QDBusConnection::sessionBus());
|
||||||
|
|
||||||
|
@ -166,9 +165,7 @@ namespace FdoSecrets
|
||||||
|
|
||||||
// only start relay signals when the collection is fully setup
|
// only start relay signals when the collection is fully setup
|
||||||
connect(coll, &Collection::collectionChanged, this, [this, coll]() { emit collectionChanged(coll); });
|
connect(coll, &Collection::collectionChanged, this, [this, coll]() { emit collectionChanged(coll); });
|
||||||
connect(coll, &Collection::collectionAboutToDelete, this, [this, coll]() {
|
connect(coll, &Collection::collectionAboutToDelete, this, [this, coll]() { emit collectionDeleted(coll); });
|
||||||
emit collectionDeleted(coll);
|
|
||||||
});
|
|
||||||
if (emitSignal) {
|
if (emitSignal) {
|
||||||
emit collectionCreated(coll);
|
emit collectionCreated(coll);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +272,10 @@ namespace FdoSecrets
|
||||||
|
|
||||||
// collection will be created when the prompt completes.
|
// collection will be created when the prompt completes.
|
||||||
// once it's done, we set additional properties on the collection
|
// once it's done, we set additional properties on the collection
|
||||||
connect(cp.value(), &CreateCollectionPrompt::collectionCreated, cp.value(), [alias, properties](Collection* coll) {
|
connect(cp.value(),
|
||||||
|
&CreateCollectionPrompt::collectionCreated,
|
||||||
|
cp.value(),
|
||||||
|
[alias, properties](Collection* coll) {
|
||||||
coll->setProperties(properties).okOrDie();
|
coll->setProperties(properties).okOrDie();
|
||||||
if (!alias.isEmpty()) {
|
if (!alias.isEmpty()) {
|
||||||
coll->addAlias(alias).okOrDie();
|
coll->addAlias(alias).okOrDie();
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit Service(FdoSecretsPlugin* plugin, QPointer<DatabaseTabWidget> dbTabs);
|
explicit Service(FdoSecretsPlugin* plugin, QPointer<DatabaseTabWidget> dbTabs);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Create a new instance of `Service`. Its parent is set to `null`
|
* @brief Create a new instance of `Service`. Its parent is set to `null`
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace FdoSecrets
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
explicit Session(std::unique_ptr<CipherPair>&& cipher, const QString& peer, Service* parent);
|
explicit Session(std::unique_ptr<CipherPair>&& cipher, const QString& peer, Service* parent);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static std::unique_ptr<CipherPair> CreateCiphers(const QString& peer,
|
static std::unique_ptr<CipherPair> CreateCiphers(const QString& peer,
|
||||||
const QString& algorithm,
|
const QString& algorithm,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue