Daemon-bound convenience wrappers around PhosphorDBus::Client. More...
Functions | |
| void | fireAndForget (QObject *parent, const QString &interface, const QString &method, const QVariantList &args, const QString &logContext={}) |
| Fire-and-forget async call to the daemon, with error logging. | |
| void | sendOneWay (const QString &interface, const QString &method, const QVariantList &args={}) |
| One-way notification to the daemon with no expected reply. | |
| QDBusPendingCall | asyncCall (const QString &interface, const QString &method, const QVariantList &args={}) |
| Async method call to the daemon; caller attaches its own watcher. | |
| QDBusMessage | syncCall (const QString &interface, const QString &method, const QVariantList &args={}) |
Blocking daemon call bounded by Service::SyncCallTimeoutMs. | |
| void | reloadDaemonSettings (QObject *parent, const QString &logContext={}) |
| Ask the daemon to reparse config.json from disk. | |
| void | reloadDaemonSettingsBlocking () |
| Blocking form of reloadDaemonSettings. | |
| template<typename Fn > | |
| void | loadSettingAsync (QObject *parent, const QString &name, Fn &&onValue) |
| Async helper for loading a single daemon setting. | |
Daemon-bound convenience wrappers around PhosphorDBus::Client.
These talk to the canonical Phosphor daemon. Code that needs to address a different service should construct its own PhosphorDBus::Client.
|
inline |
Async method call to the daemon; caller attaches its own watcher.
|
inline |
Fire-and-forget async call to the daemon, with error logging.
| void PhosphorProtocol::ClientHelpers::loadSettingAsync | ( | QObject * | parent, |
| const QString & | name, | ||
| Fn && | onValue | ||
| ) |
Async helper for loading a single daemon setting.
Sends getSetting(name) to the Settings interface, unwraps the QDBusVariant, and calls onValue with the extracted QVariant.
| parent | QObject parent for the watcher |
| name | Setting name to load |
| onValue | Callback receiving the unwrapped QVariant value (captured by move into the lambda — callers must pass a fresh rvalue each call) |
|
inline |
Ask the daemon to reparse config.json from disk.
Every settings writer in the tree writes config.json IN PROCESS and then tells the daemon to reparse — nothing writes a setting over the bus. The reload is not a courtesy: a backend sync rewrites the WHOLE document from its in-memory root, so a daemon still holding the pre-write snapshot would put the old values back on its next flush, from any source, at any later time.
Async and error-logged. Prefer this: the notification's only consumer is the daemon, so a caller with nothing to order against the reply gains nothing from blocking on it. Blocking does NOT close the clobber window either — the daemon can flush between the write and the reparse whether or not the writer waits — it only makes the writer wait out the round trip.
| parent | Owns the reply watcher; must outlive the round trip. |
| logContext | Prefix for the failure warning. |
|
inline |
Blocking form of reloadDaemonSettings.
Only for a caller with a real ordering requirement against the reply — the settings app's SettingsController clears its m_saving guard once this returns (the KCM is only a launcher for it), and an async call there races: the daemon's settingsChanged can land after the guard is clear and trigger a spurious load() that reverts the just-saved assignments. A caller that only needs the daemon to catch up eventually wants the async form.
Bounded by Service::SyncCallTimeoutMs.
|
inline |
One-way notification to the daemon with no expected reply.
|
inline |
Blocking daemon call bounded by Service::SyncCallTimeoutMs.
Prefer asyncCall whenever the caller can tolerate a callback.