normalize D-Bus naming in comments

This commit is contained in:
Maciej Szeptuch 2022-08-14 15:38:52 +02:00
parent 6557970fd9
commit e155cc4e7a
No known key found for this signature in database
GPG Key ID: E4F948F71FEE7375
20 changed files with 61 additions and 61 deletions

View File

@ -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

View File

@ -56,7 +56,7 @@ public:
FdoSecrets::Service* serviceInstance() const;
/**
* @brief The dbus manager instance
* @brief The D-Bus manager instance
* @return
*/
const QSharedPointer<FdoSecrets::DBusMgr>& dbus() const;

View File

@ -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

View File

@ -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);

View File

@ -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
{

View File

@ -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;
}

View File

@ -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.<br/>").arg(DBUS_SERVICE_SECRET) + existing);
emit error(tr("Failed to register D-Bus service at %1.<br/>").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*

View File

@ -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<QString, DBusClientPtr> m_clients{};
DBusClientPtr m_overrideClient;

View File

@ -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

View File

@ -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

View File

@ -426,7 +426,7 @@ namespace FdoSecrets
emit collectionAboutToDelete();
// remove from dbus early
// remove from D-Bus early
dbus()->unregisterObject(this);
// cleanup connection on Database

View File

@ -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();

View File

@ -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);

View File

@ -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:

View File

@ -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();
}

View File

@ -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<CipherPair> cipher, const QString& peer, Service* parent);

View File

@ -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"),
};

View File

@ -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
*/

View File

@ -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;
}

View File

@ -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;
}