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