Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorConfig::HostResolution Struct Reference

Which host's settings file a module edits, from HostDirectory::resolve(). More...

#include <PhosphorConfig/HostDirectory.h>

Public Attributes

std::optional< HostDescriptor > host
 The host, or nullopt when none could be chosen: no record chose one and the session's desktops match several descriptors (see candidates) or none.
QString configPath
 The file to edit.
QList< HostDescriptor > candidates
 Several descriptors match this session and nothing chose between them: ask the user, then writeRecord() the answer with pid 0.
bool running = false
 Some process owns the API's bus name.

Detailed Description

Which host's settings file a module edits, from HostDirectory::resolve().

Member Data Documentation

◆ candidates

QList<HostDescriptor> PhosphorConfig::HostResolution::candidates

Several descriptors match this session and nothing chose between them: ask the user, then writeRecord() the answer with pid 0.

Empty when a host was chosen, and also when no descriptor matches the session's desktops, where host is nullopt with nothing to offer.

◆ configPath

QString PhosphorConfig::HostResolution::configPath

The file to edit.

When a record chose the host it is the record's path as it was written, which is not compared with the descriptor's and is stale if the host has moved its file since. Otherwise it is the descriptor's resolved path. Empty when there is no host.

◆ host

std::optional<HostDescriptor> PhosphorConfig::HostResolution::host

The host, or nullopt when none could be chosen: no record chose one and the session's desktops match several descriptors (see candidates) or none.

◆ running

bool PhosphorConfig::HostResolution::running = false

Some process owns the API's bus name.

That process is known to be the resolved host only when the record that chose the host was written by it, which is the one case where the owner is sure to be the process to ask to reload after a write. Under every other rule the owner can be a different host.

Owning the name is not the same as answering on it. A host takes its bus name, and PlasmaZones writes its record, before it registers the objects behind the name, so for a moment at start a call to the owner fails with org.freedesktop.DBus.Error.UnknownObject although running is true and the host's fresh record already satisfies rule 1 of resolve(). A module that asks the host to reload should retry such a reply for a short while rather than read it as the host not running.


The documentation for this struct was generated from the following file: