44 if (!groupName.startsWith(prefix))
46 QString remainder = groupName.mid(prefix.size());
47 if (remainder.isEmpty())
50 int actIdx = remainder.indexOf(QLatin1String(
":Activity:"));
52 const QString
activity = remainder.mid(actIdx + 10);
55 remainder = remainder.left(actIdx);
57 int deskIdx = remainder.indexOf(QLatin1String(
":Desktop:"));
60 int desktop = remainder.mid(deskIdx + 9).toInt(&ok);
61 if (ok && desktop > 0)
63 remainder = remainder.left(deskIdx);
QString makeAutotileId(const QString &algorithmId)
Definition LayoutId.h:50
bool isAutotile(const QString &id)
Definition LayoutId.h:28
QString extractAlgorithmId(const QString &id)
Extract the algorithm id portion from an autotile preview id.
Definition LayoutId.h:38
Definition IWindowTrackingService.h:22
size_t qHash(const LayoutAssignmentKey &key, size_t seed=0)
Definition AssignmentEntry.h:70
Explicit per-context assignment entry storing both mode fields.
Definition AssignmentEntry.h:86
QString snappingLayout
Definition AssignmentEntry.h:92
static AssignmentEntry fromLayoutId(const QString &layoutId)
Create a fresh AssignmentEntry from a layoutId string.
Definition AssignmentEntry.h:138
static AssignmentEntry fromLayoutId(const QString &layoutId, const AssignmentEntry &existing)
Update an existing AssignmentEntry from a layoutId, preserving the "other" field.
Definition AssignmentEntry.h:125
QString activeLayoutId() const
Definition AssignmentEntry.h:95
Mode
Definition AssignmentEntry.h:87
@ Snapping
Definition AssignmentEntry.h:88
@ Autotile
Definition AssignmentEntry.h:89
bool operator==(const AssignmentEntry &other) const
Definition AssignmentEntry.h:115
bool isValid() const
Definition AssignmentEntry.h:111
QString tilingAlgorithm
Definition AssignmentEntry.h:93
Mode mode
Definition AssignmentEntry.h:91
Key for layout assignment (screen + desktop + activity)
Definition AssignmentEntry.h:17
static LayoutAssignmentKey fromGroupName(const QString &groupName, const QString &prefix)
Parse a "<prefix><screenId>[:Desktop:N][:Activity:uuid]" group name.
Definition AssignmentEntry.h:41
bool operator==(const LayoutAssignmentKey &other) const
Definition AssignmentEntry.h:22
QString screenId
Definition AssignmentEntry.h:18
int virtualDesktop
Definition AssignmentEntry.h:19
QString activity
Definition AssignmentEntry.h:20