diff --git a/src/fdosecrets/objects/Collection.cpp b/src/fdosecrets/objects/Collection.cpp index 4dff58f52d..b8f1ac2725 100644 --- a/src/fdosecrets/objects/Collection.cpp +++ b/src/fdosecrets/objects/Collection.cpp @@ -416,7 +416,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); diff --git a/src/fdosecrets/objects/Collection.h b/src/fdosecrets/objects/Collection.h index 1018078736..80940d5a73 100644 --- a/src/fdosecrets/objects/Collection.h +++ b/src/fdosecrets/objects/Collection.h @@ -41,6 +41,7 @@ namespace FdoSecrets Q_OBJECT explicit Collection(Service* parent, DatabaseWidget* backend); + public: /** * @brief Create a new instance of `Collection` diff --git a/src/fdosecrets/objects/Item.h b/src/fdosecrets/objects/Item.h index 9707797068..8c753a3d52 100644 --- a/src/fdosecrets/objects/Item.h +++ b/src/fdosecrets/objects/Item.h @@ -43,6 +43,7 @@ namespace FdoSecrets Q_OBJECT explicit Item(Collection* parent, Entry* backend); + public: /** * @brief Create a new instance of `Item`. diff --git a/src/fdosecrets/objects/Prompt.cpp b/src/fdosecrets/objects/Prompt.cpp index 6bbc628467..8b3534a9bc 100644 --- a/src/fdosecrets/objects/Prompt.cpp +++ b/src/fdosecrets/objects/Prompt.cpp @@ -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::Create(Service* parent, const QList& coll) + DBusReturn UnlockCollectionsPrompt::Create(Service* parent, + const QList& coll) { std::unique_ptr res{new UnlockCollectionsPrompt(parent, coll)}; if (!res->registerSelf()) { diff --git a/src/fdosecrets/objects/Prompt.h b/src/fdosecrets/objects/Prompt.h index e72f0512c3..9a97256754 100644 --- a/src/fdosecrets/objects/Prompt.h +++ b/src/fdosecrets/objects/Prompt.h @@ -58,6 +58,7 @@ namespace FdoSecrets Q_OBJECT explicit DeleteCollectionPrompt(Service* parent, Collection* coll); + public: static DBusReturn Create(Service* parent, Collection* coll); @@ -72,6 +73,7 @@ namespace FdoSecrets Q_OBJECT explicit CreateCollectionPrompt(Service* parent); + public: static DBusReturn Create(Service* parent); @@ -87,6 +89,7 @@ namespace FdoSecrets Q_OBJECT explicit LockCollectionsPrompt(Service* parent, const QList& colls); + public: static DBusReturn Create(Service* parent, const QList& colls); @@ -103,6 +106,7 @@ namespace FdoSecrets Q_OBJECT explicit UnlockCollectionsPrompt(Service* parent, const QList& coll); + public: static DBusReturn Create(Service* parent, const QList& coll); @@ -124,6 +128,7 @@ namespace FdoSecrets Q_OBJECT explicit DeleteItemPrompt(Service* parent, Item* item); + public: static DBusReturn Create(Service* parent, Item* item); diff --git a/src/fdosecrets/objects/Service.cpp b/src/fdosecrets/objects/Service.cpp index df26806db2..7d85cdd00c 100644 --- a/src/fdosecrets/objects/Service.cpp +++ b/src/fdosecrets/objects/Service.cpp @@ -69,8 +69,9 @@ namespace FdoSecrets bool Service::initialize() { if (!QDBusConnection::sessionBus().registerService(QStringLiteral(DBUS_SERVICE_SECRET))) { - plugin()->emitError(tr("Failed to register DBus service at %1.
").arg(QLatin1String(DBUS_SERVICE_SECRET)) - + m_plugin->reportExistingService()); + plugin()->emitError( + tr("Failed to register DBus service at %1.
").arg(QLatin1String(DBUS_SERVICE_SECRET)) + + m_plugin->reportExistingService()); return false; } @@ -81,10 +82,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()); @@ -167,9 +166,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); } @@ -276,12 +273,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; } diff --git a/src/fdosecrets/objects/Service.h b/src/fdosecrets/objects/Service.h index 680df71184..8aad680379 100644 --- a/src/fdosecrets/objects/Service.h +++ b/src/fdosecrets/objects/Service.h @@ -50,6 +50,7 @@ namespace FdoSecrets Q_OBJECT explicit Service(FdoSecretsPlugin* plugin, QPointer dbTabs); + public: /** * @brief Create a new instance of `Service`. Its parent is set to `null` diff --git a/src/fdosecrets/objects/Session.h b/src/fdosecrets/objects/Session.h index 5722895adc..3bb6ea2575 100644 --- a/src/fdosecrets/objects/Session.h +++ b/src/fdosecrets/objects/Session.h @@ -39,6 +39,7 @@ namespace FdoSecrets Q_OBJECT explicit Session(std::unique_ptr&& cipher, const QString& peer, Service* parent); + public: static std::unique_ptr CreateCiphers(const QString& peer, const QString& algorithm,