From e155cc4e7ac7b25c5fc292c0ffba4d6748990251 Mon Sep 17 00:00:00 2001 From: Maciej Szeptuch Date: Sun, 14 Aug 2022 15:38:52 +0200 Subject: [PATCH] normalize D-Bus naming in comments --- src/fdosecrets/CMakeLists.txt | 2 +- src/fdosecrets/FdoSecretsPlugin.h | 2 +- src/fdosecrets/README.md | 10 ++++----- src/fdosecrets/dbus/DBusClient.cpp | 2 +- src/fdosecrets/dbus/DBusClient.h | 10 ++++----- src/fdosecrets/dbus/DBusDispatch.cpp | 6 +++--- src/fdosecrets/dbus/DBusMgr.cpp | 28 ++++++++++++------------- src/fdosecrets/dbus/DBusMgr.h | 18 ++++++++-------- src/fdosecrets/dbus/DBusObject.h | 6 +++--- src/fdosecrets/dbus/DBusTypes.h | 4 ++-- src/fdosecrets/objects/Collection.cpp | 2 +- src/fdosecrets/objects/Collection.h | 4 ++-- src/fdosecrets/objects/Item.cpp | 4 ++-- src/fdosecrets/objects/Item.h | 4 ++-- src/fdosecrets/objects/Prompt.cpp | 2 +- src/fdosecrets/objects/Session.h | 2 +- src/fdosecrets/widgets/SettingsModels.h | 2 +- src/gui/MainWindow.cpp | 4 ++-- src/gui/osutils/nixutils/NixUtils.cpp | 4 ++-- src/quickunlock/Polkit.cpp | 6 +++--- 20 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/fdosecrets/CMakeLists.txt b/src/fdosecrets/CMakeLists.txt index efaed2d03..dad93e2eb 100644 --- a/src/fdosecrets/CMakeLists.txt +++ b/src/fdosecrets/CMakeLists.txt @@ -20,7 +20,7 @@ if(WITH_XC_FDOSECRETS) # setting storage FdoSecretsSettings.cpp - # dbus objects + # D-Bus objects dbus/DBusClient.cpp dbus/DBusMgr.cpp dbus/DBusDispatch.cpp diff --git a/src/fdosecrets/FdoSecretsPlugin.h b/src/fdosecrets/FdoSecretsPlugin.h index 5884cc62e..7e4c573a1 100644 --- a/src/fdosecrets/FdoSecretsPlugin.h +++ b/src/fdosecrets/FdoSecretsPlugin.h @@ -56,7 +56,7 @@ public: FdoSecrets::Service* serviceInstance() const; /** - * @brief The dbus manager instance + * @brief The D-Bus manager instance * @return */ const QSharedPointer& dbus() const; diff --git a/src/fdosecrets/README.md b/src/fdosecrets/README.md index 059bdae22..a3a8e8ed0 100644 --- a/src/fdosecrets/README.md +++ b/src/fdosecrets/README.md @@ -1,16 +1,16 @@ # Freedesktop.org Secret Storage Spec Server Side API This plugin implements the [Secret Storage specification][secrets] version 0.2. While running KeePassXC, it acts as a -Secret Service server, registered on DBus, so clients like seahorse, python-secretstorage, or other implementations +Secret Service server, registered on D-Bus, so clients like seahorse, python-secretstorage, or other implementations can connect and access the exposed database in KeePassXC. [secrets]: (https://www.freedesktop.org/wiki/Specifications/secret-storage-spec/) ## Configurable settings -* The user can specify if a database is exposed on DBus, and which group is exposed. +* The user can specify if a database is exposed on D-Bus, and which group is exposed. * Whether to show desktop notification is shown when an entry's secret is retrieved. -* Whether to confirm for entries deleted from DBus +* Whether to confirm for entries deleted from D-Bus * Whether to confirm each entry's access ## Implemented Attributes on Item Object @@ -29,9 +29,9 @@ In addition, all non-protected custom attributes are also exposed. ## Implementation -* `FdoSecrets::Service` is the top level DBus service +* `FdoSecrets::Service` is the top level D-Bus service * There is one and only one `FdoSecrets::Collection` per opened database tab -* Each entry under the exposed database group has a corresponding `FdoSecrets::Item` DBus object. +* Each entry under the exposed database group has a corresponding `FdoSecrets::Item` D-Bus object. ### Signal connections diff --git a/src/fdosecrets/dbus/DBusClient.cpp b/src/fdosecrets/dbus/DBusClient.cpp index 36cb927bf..84790f45c 100644 --- a/src/fdosecrets/dbus/DBusClient.cpp +++ b/src/fdosecrets/dbus/DBusClient.cpp @@ -63,7 +63,7 @@ namespace FdoSecrets { auto exePath = m_process.exePath(); if (exePath.isEmpty()) { - return QObject::tr("unknown executable (DBus address %1)").arg(m_process.address); + return QObject::tr("unknown executable (D-Bus address %1)").arg(m_process.address); } if (!m_process.valid) { return QObject::tr("%1 (invalid executable path)").arg(exePath); diff --git a/src/fdosecrets/dbus/DBusClient.h b/src/fdosecrets/dbus/DBusClient.h index 3d9e94d05..4cdcd88e4 100644 --- a/src/fdosecrets/dbus/DBusClient.h +++ b/src/fdosecrets/dbus/DBusClient.h @@ -44,12 +44,12 @@ namespace FdoSecrets /** * Contains info representing a process. - * This can be obtained by DBusMgr::serviceInfo given a dbus address. + * This can be obtained by DBusMgr::serviceInfo given a D-Bus address. */ struct PeerInfo { /** - * @brief DBus address + * @brief D-Bus address */ QString address; @@ -82,10 +82,10 @@ namespace FdoSecrets /** * Represent a client that has made requests to our service. A client is identified by its - * DBus address, which is guaranteed to be unique by the DBus protocol. + * D-Bus address, which is guaranteed to be unique by the D-Bus protocol. * * An object of this class is created on the first request and destroyed - * when the client address vanishes from the bus. DBus guarantees that the + * when the client address vanishes from the bus. D-Bus guarantees that the * client address is not reused. * * One client may have multiple `Session`s with our service, and this class @@ -110,7 +110,7 @@ namespace FdoSecrets QString name() const; /** - * @return The unique DBus address of the client + * @return The unique D-Bus address of the client */ QString address() const { diff --git a/src/fdosecrets/dbus/DBusDispatch.cpp b/src/fdosecrets/dbus/DBusDispatch.cpp index 4912f1340..9d07ca736 100644 --- a/src/fdosecrets/dbus/DBusDispatch.cpp +++ b/src/fdosecrets/dbus/DBusDispatch.cpp @@ -95,7 +95,7 @@ namespace FdoSecrets continue; } - // map from function name to dbus name + // map from function name to D-Bus name auto member = camelToPascal(mm.name()); // also "remove" => "Delete" due to c++ keyword restriction if (member == "Remove") { @@ -132,7 +132,7 @@ namespace FdoSecrets md.outputTypes.append(id); auto paramData = typeToWireType(id); if (paramData.signature.isEmpty()) { - qDebug() << "Internal error: unhandled new output type for dbus signature" << paramType; + qDebug() << "Internal error: unhandled new output type for D-Bus signature" << paramType; valid = false; break; } @@ -149,7 +149,7 @@ namespace FdoSecrets } auto sig = typeToWireType(id).signature; if (sig.isEmpty()) { - qDebug() << "Internal error: unhandled new parameter type for dbus signature" << paramType; + qDebug() << "Internal error: unhandled new parameter type for D-Bus signature" << paramType; valid = false; break; } diff --git a/src/fdosecrets/dbus/DBusMgr.cpp b/src/fdosecrets/dbus/DBusMgr.cpp index 065417f0c..fa2948260 100644 --- a/src/fdosecrets/dbus/DBusMgr.cpp +++ b/src/fdosecrets/dbus/DBusMgr.cpp @@ -232,7 +232,7 @@ namespace FdoSecrets void DBusMgr::populateMethodCache() { - // these are the methods we expose on DBus + // these are the methods we expose on D-Bus populateMethodCache(Service::staticMetaObject); populateMethodCache(Collection::staticMetaObject); populateMethodCache(Item::staticMetaObject); @@ -296,8 +296,8 @@ namespace FdoSecrets { bool ok = m_conn.send(reply); if (!ok) { - qDebug() << "Failed to send on DBus:" << reply; - emit error(tr("Failed to send reply on DBus")); + qDebug() << "Failed to send on D-Bus:" << reply; + emit error(tr("Failed to send reply on D-Bus")); } return ok; } @@ -423,16 +423,16 @@ namespace FdoSecrets { if (!m_conn.registerService(DBUS_SERVICE_SECRET)) { const auto existing = reportExistingService(); - qDebug() << "Failed to register DBus service at " << DBUS_SERVICE_SECRET; + qDebug() << "Failed to register D-Bus service at " << DBUS_SERVICE_SECRET; qDebug() << existing; - emit error(tr("Failed to register DBus service at %1.
").arg(DBUS_SERVICE_SECRET) + existing); + emit error(tr("Failed to register D-Bus service at %1.
").arg(DBUS_SERVICE_SECRET) + existing); return false; } connect(service, &DBusObject::destroyed, this, [this]() { m_conn.unregisterService(DBUS_SERVICE_SECRET); }); if (!registerObject(DBUS_PATH_SECRETS, service)) { - qDebug() << "Failed to register service on DBus at path" << DBUS_PATH_SECRETS; - emit error(tr("Failed to register service on DBus at path '%1'").arg(DBUS_PATH_SECRETS)); + qDebug() << "Failed to register service on D-Bus at path" << DBUS_PATH_SECRETS; + emit error(tr("Failed to register service on D-Bus at path '%1'").arg(DBUS_PATH_SECRETS)); return false; } @@ -453,8 +453,8 @@ namespace FdoSecrets path = DBUS_PATH_TEMPLATE_COLLECTION.arg(DBUS_PATH_SECRETS, name); if (!registerObject(path, coll)) { - qDebug() << "Failed to register database on DBus under name" << name; - emit error(tr("Failed to register database on DBus under the name '%1'").arg(name)); + qDebug() << "Failed to register database on D-Bus under name" << name; + emit error(tr("Failed to register database on D-Bus under the name '%1'").arg(name)); return false; } } @@ -469,7 +469,7 @@ namespace FdoSecrets { auto path = DBUS_PATH_TEMPLATE_SESSION.arg(DBUS_PATH_SECRETS, sess->id()); if (!registerObject(path, sess)) { - emit error(tr("Failed to register session on DBus at path '%1'").arg(path)); + emit error(tr("Failed to register session on D-Bus at path '%1'").arg(path)); return false; } return true; @@ -479,7 +479,7 @@ namespace FdoSecrets { auto path = DBUS_PATH_TEMPLATE_ITEM.arg(item->collection()->objectPath().path(), item->backend()->uuidToHex()); if (!registerObject(path, item)) { - emit error(tr("Failed to register item on DBus at path '%1'").arg(path)); + emit error(tr("Failed to register item on D-Bus at path '%1'").arg(path)); return false; } @@ -492,7 +492,7 @@ namespace FdoSecrets { auto path = DBUS_PATH_TEMPLATE_PROMPT.arg(DBUS_PATH_SECRETS, Tools::uuidToHex(QUuid::createUuid())); if (!registerObject(path, prompt)) { - emit error(tr("Failed to register prompt object on DBus at path '%1'").arg(path)); + emit error(tr("Failed to register prompt object on D-Bus at path '%1'").arg(path)); return false; } @@ -514,8 +514,8 @@ namespace FdoSecrets { auto path = DBUS_PATH_TEMPLATE_ALIAS.arg(DBUS_PATH_SECRETS, alias); if (!registerObject(path, coll, false)) { - qDebug() << "Failed to register database on DBus under alias" << alias; - // usually this is reported back directly on dbus, so no need to show in UI + qDebug() << "Failed to register database on D-Bus under alias" << alias; + // usually this is reported back directly on D-Bus, so no need to show in UI return false; } // alias signals are handled together with collections' primary path in emitCollection* diff --git a/src/fdosecrets/dbus/DBusMgr.h b/src/fdosecrets/dbus/DBusMgr.h index bc32e6fe6..2a1a1a15a 100644 --- a/src/fdosecrets/dbus/DBusMgr.h +++ b/src/fdosecrets/dbus/DBusMgr.h @@ -39,17 +39,17 @@ namespace FdoSecrets class DBusResult; /** - * DBusMgr takes care of the interaction between dbus and business logic objects (DBusObject). It handles the + * DBusMgr takes care of the interaction between D-Bus and business logic objects (DBusObject). It handles the * following * - Registering/unregistering service name * - Registering/unregistering paths - * - Relay signals from DBusObject to dbus - * - Manage per-client states, mapping from dbus caller address to Client - * - Deliver method calls from dbus to DBusObject + * - Relay signals from DBusObject to D-Bus + * - Manage per-client states, mapping from D-Bus caller address to Client + * - Deliver method calls from D-Bus to DBusObject * * Special note in implementation of method delivery: * There are two sets of vocabulary classes in use for method delivery. - * The Qt DBus system uses QDBusVariant/QDBusObjectPath and other primitive types in QDBusMessage::arguments(), + * The Qt D-Bus system uses QDBusVariant/QDBusObjectPath and other primitive types in QDBusMessage::arguments(), * i.e. the on-the-wire types. * The DBusObject invokable methods uses QVariant/DBusObject* and other primitive types in parameters (parameter * types). FdoSecrets::typeToWireType establishes the mapping from parameter types to on-the-wire types. The @@ -64,7 +64,7 @@ namespace FdoSecrets * by DBusObject * * prepare output argument storage * * call the method - * * convert types to what Qt DBus expects + * * convert types to what Qt D-Bus expects * * The MethodData is pre-computed using Qt meta object system by finding methods with signature matching a certain * pattern: @@ -82,7 +82,7 @@ namespace FdoSecrets explicit DBusMgr(); /** - * @brief Must be called after all dbus types are registered + * @brief Must be called after all D-Bus types are registered */ void populateMethodCache(); @@ -107,7 +107,7 @@ namespace FdoSecrets */ QString reportExistingService() const; - // expose on dbus and handle signals + // expose on D-Bus and handle signals bool registerObject(Service* service); bool registerObject(Collection* coll); bool registerObject(Session* sess); @@ -312,7 +312,7 @@ namespace FdoSecrets void removeClient(DBusClient* client); QDBusServiceWatcher m_watcher{}; - // mapping from the unique dbus peer address to client object + // mapping from the unique D-Bus peer address to client object QHash m_clients{}; DBusClientPtr m_overrideClient; diff --git a/src/fdosecrets/dbus/DBusObject.h b/src/fdosecrets/dbus/DBusObject.h index 8984cf17e..6a9320836 100644 --- a/src/fdosecrets/dbus/DBusObject.h +++ b/src/fdosecrets/dbus/DBusObject.h @@ -34,7 +34,7 @@ namespace FdoSecrets class Service; /** - * @brief A common base class for all dbus-exposed objects. + * @brief A common base class for all D-Bus-exposed objects. */ class DBusObject : public QObject { @@ -72,7 +72,7 @@ namespace FdoSecrets }; /** - * @brief A dbus error or not + * @brief A D-Bus error or not */ class DBusResult : public QString { @@ -104,7 +104,7 @@ namespace FdoSecrets }; /** - * Encode the string value to a DBus object path safe representation, + * Encode the string value to a D-Bus object path safe representation, * using a schema similar to URI encoding, but with percentage(%) replaced with * underscore(_). All characters except [A-Za-z0-9] are encoded. For non-ascii * characters, UTF-8 encoding is first applied and each of the resulting byte diff --git a/src/fdosecrets/dbus/DBusTypes.h b/src/fdosecrets/dbus/DBusTypes.h index e0e44890f..b6b9e9f28 100644 --- a/src/fdosecrets/dbus/DBusTypes.h +++ b/src/fdosecrets/dbus/DBusTypes.h @@ -27,7 +27,7 @@ namespace FdoSecrets struct Secret; class DBusMgr; - // types used directly in Qt DBus system + // types used directly in Qt D-Bus system namespace wire { struct Secret @@ -87,7 +87,7 @@ namespace FdoSecrets }; /** - * @brief Convert parameter type to on-the-wire type and associated dbus signature. + * @brief Convert parameter type to on-the-wire type and associated D-Bus signature. * This is NOT a generic version, and only handles types used in org.freedesktop.secrets * @param id * @return ParamData diff --git a/src/fdosecrets/objects/Collection.cpp b/src/fdosecrets/objects/Collection.cpp index d608b1d20..e09a21189 100644 --- a/src/fdosecrets/objects/Collection.cpp +++ b/src/fdosecrets/objects/Collection.cpp @@ -426,7 +426,7 @@ namespace FdoSecrets emit collectionAboutToDelete(); - // remove from dbus early + // remove from D-Bus early dbus()->unregisterObject(this); // cleanup connection on Database diff --git a/src/fdosecrets/objects/Collection.h b/src/fdosecrets/objects/Collection.h index f8b3c7125..361c5a457 100644 --- a/src/fdosecrets/objects/Collection.h +++ b/src/fdosecrets/objects/Collection.h @@ -47,7 +47,7 @@ namespace FdoSecrets * @param name the collection name * @return pointer to created instance, or nullptr when error happens. * This may be caused by - * - DBus path registration error + * - D-Bus path registration error */ static Collection* Create(Service* parent, const QString& name); ~Collection() override; @@ -127,7 +127,7 @@ namespace FdoSecrets Item* doNewItem(const DBusClientPtr& client, QString itemPath); - // Only delete from dbus, will remove self. Do not affect database in KPXC + // Only delete from D-Bus, will remove self. Do not affect database in KPXC void removeFromDBus(); void reloadBackend(); diff --git a/src/fdosecrets/objects/Item.cpp b/src/fdosecrets/objects/Item.cpp index 37e4c4a71..add093a1c 100644 --- a/src/fdosecrets/objects/Item.cpp +++ b/src/fdosecrets/objects/Item.cpp @@ -74,7 +74,7 @@ namespace FdoSecrets , m_backend(backend) { connect(m_backend, &Entry::modified, this, &Item::itemChanged); - // Remove from dbus when deleted + // Remove from D-Bus when deleted connect(m_backend->group(), &Group::entryAboutToRemove, this, [this](Entry* toBeRemoved) { if (m_backend == toBeRemoved) { removeFromDBus(); @@ -384,7 +384,7 @@ namespace FdoSecrets emit itemAboutToDelete(); // Unregister current path early, do not rely on deleteLater's call to destructor - // as in case of Entry moving between groups, new Item will be created at the same DBus path + // as in case of Entry moving between groups, new Item will be created at the same D-Bus path // before the current Item is deleted in the event loop. dbus()->unregisterObject(this); diff --git a/src/fdosecrets/objects/Item.h b/src/fdosecrets/objects/Item.h index a3e7a4339..059557754 100644 --- a/src/fdosecrets/objects/Item.h +++ b/src/fdosecrets/objects/Item.h @@ -53,7 +53,7 @@ namespace FdoSecrets * @param backend the `Entry` containing the data * @return pointer to newly created Item, or nullptr if error * This may be caused by - * - DBus path registration error + * - D-Bus path registration error */ static Item* Create(Collection* parent, Entry* backend); ~Item() override; @@ -114,7 +114,7 @@ namespace FdoSecrets // will actually delete the entry in KPXC bool doDelete(const DBusClientPtr& client) const; - // Only delete from dbus, will remove self. Do not affect database in KPXC + // Only delete from D-Bus, will remove self. Do not affect database in KPXC void removeFromDBus(); private slots: diff --git a/src/fdosecrets/objects/Prompt.cpp b/src/fdosecrets/objects/Prompt.cpp index 54bee9535..84880c3bb 100644 --- a/src/fdosecrets/objects/Prompt.cpp +++ b/src/fdosecrets/objects/Prompt.cpp @@ -107,7 +107,7 @@ namespace FdoSecrets OverrideParentWindow override(this, windowId); if (m_collection) { - // Collection removal is just disconnecting it from dbus. + // Collection removal is just disconnecting it from D-Bus. // GUI then reacts with potentially closing the database. m_collection->removeFromDBus(); } diff --git a/src/fdosecrets/objects/Session.h b/src/fdosecrets/objects/Session.h index 361f7157f..3a4905b22 100644 --- a/src/fdosecrets/objects/Session.h +++ b/src/fdosecrets/objects/Session.h @@ -38,7 +38,7 @@ namespace FdoSecrets * @param parent the owning Service * @return pointer to newly created Session, or nullptr if error * This may be caused by - * - DBus path registration error + * - D-Bus path registration error */ static Session* Create(QSharedPointer cipher, const QString& peer, Service* parent); diff --git a/src/fdosecrets/widgets/SettingsModels.h b/src/fdosecrets/widgets/SettingsModels.h index a6cdf41de..a55d3bc4c 100644 --- a/src/fdosecrets/widgets/SettingsModels.h +++ b/src/fdosecrets/widgets/SettingsModels.h @@ -93,7 +93,7 @@ namespace FdoSecrets static constexpr const char* ColumnNames[] = { QT_TRANSLATE_NOOP("SettingsClientModel", "Application"), QT_TRANSLATE_NOOP("SettingsClientModel", "PID"), - QT_TRANSLATE_NOOP("SettingsClientModel", "DBus Address"), + QT_TRANSLATE_NOOP("SettingsClientModel", "D-Bus Address"), QT_TRANSLATE_NOOP("SettingsClientModel", "Manage"), }; diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7c0a0d5cb..917ae0a24 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -722,7 +722,7 @@ void MainWindow::appExit() /** * Returns if application was built with hardware key support. - * Intended to be used by 3rd-party applications using DBus. + * Intended to be used by 3rd-party applications using D-Bus. * * @return True if built with hardware key support, false otherwise */ @@ -738,7 +738,7 @@ bool MainWindow::isHardwareKeySupported() /** * Refreshes list of hardware keys known. * Triggers the DatabaseOpenWidget to automatically select the key last used for a database if found. - * Intended to be used by 3rd-party applications using DBus. + * Intended to be used by 3rd-party applications using D-Bus. * * @return True if any key was found, false otherwise or if application lacks hardware key support */ diff --git a/src/gui/osutils/nixutils/NixUtils.cpp b/src/gui/osutils/nixutils/NixUtils.cpp index c2ca1d4da..5e5b56c8d 100644 --- a/src/gui/osutils/nixutils/NixUtils.cpp +++ b/src/gui/osutils/nixutils/NixUtils.cpp @@ -197,7 +197,7 @@ void NixUtils::setLaunchAtStartup(bool enable) SLOT(launchAtStartupRequested(uint, QVariantMap))); if (!res) { - qDebug() << "DBus Error: could not connect to org.freedesktop.portal.Request"; + qDebug() << "D-Bus Error: could not connect to org.freedesktop.portal.Request"; } #endif } @@ -205,7 +205,7 @@ void NixUtils::setLaunchAtStartup(bool enable) void NixUtils::launchAtStartupRequested(uint response, const QVariantMap& results) { if (response > 0) { - qDebug() << "DBus Error: the request to autostart was cancelled."; + qDebug() << "D-Bus Error: the request to autostart was cancelled."; return; } diff --git a/src/quickunlock/Polkit.cpp b/src/quickunlock/Polkit.cpp index d73a7c71b..ef8c69883 100644 --- a/src/quickunlock/Polkit.cpp +++ b/src/quickunlock/Polkit.cpp @@ -49,7 +49,7 @@ Polkit::Polkit() PolkitSubject::registerMetaType(); PolkitAuthorizationResults::registerMetaType(); - /* Note we explicitly use our own dbus path here, as the ::systemBus() method could be overridden + /* Note we explicitly use our own D-Bus path here, as the ::systemBus() method could be overridden through an environment variable to return an alternative bus path. This bus could have an application pretending to be polkit running on it, which could approve every authentication request @@ -61,14 +61,14 @@ Polkit::Polkit() m_available = bus.isConnected(); if (!m_available) { - qDebug() << "polkit: Failed to connect to system dbus (this may be due to a non-standard dbus path)"; + qDebug() << "polkit: Failed to connect to system D-Bus (this may be due to a non-standard D-Bus path)"; return; } m_available = bus.interface()->isServiceRegistered(polkit_service); if (!m_available) { - qDebug() << "polkit: Polkit is not registered on dbus"; + qDebug() << "polkit: Polkit is not registered on D-Bus"; return; }