LayoutPreview::id namespace utilities. More...
Functions | |
| bool | isAutotile (const QString &id) |
| QString | extractAlgorithmId (const QString &id) |
| Extract the algorithm id portion from an autotile preview id. | |
| QString | makeAutotileId (const QString &algorithmId) |
| QString | normalizeAlgorithmId (const QString &id) |
Normalize an algorithm-id-or-prefixed-layout-id into the canonical autotile:<algo> form: pass-through when already prefixed, prefix when raw. | |
Variables | |
| constexpr QLatin1String | AutotilePrefix {"autotile:"} |
LayoutPreview::id namespace utilities.
Manual zone layouts use UUID strings; autotile-algorithm previews use the prefixed form "autotile:<algorithmId>" so manual + autotile IDs share a single namespace at the consumer level. Everyone who needs to build / parse / classify a LayoutPreview id goes through the helpers here — no inline "autotile:" literals outside this namespace.
Lives in phosphor-layout-api because both phosphor-zones and phosphor-tiles produce LayoutPreview values with these IDs, and every consumer of ILayoutSource must be able to classify an id without pulling in either library-specific header.
|
inline |
Extract the algorithm id portion from an autotile preview id.
Callers are expected to check isAutotile first — passing a non-autotile id here is a contract violation. We warn and return an empty string so the misuse is loud rather than silent, but remain graceful in release (no assert — the empty return gives callers a testable signal).
|
inline |
|
inline |
|
inline |
Normalize an algorithm-id-or-prefixed-layout-id into the canonical autotile:<algo> form: pass-through when already prefixed, prefix when raw.
Empty input returns empty (no autotile: wrap). Centralises the prefix-or-not check that several daemon readers apply to the raw entry.tilingAlgorithm field so it round-trips with the prefixed LayoutComboBox model values.
|
inlineconstexpr |