* @brief Resolves a serialized geometry/order entry to the current session's * windowId, preferring the stable key over the legacy integer. */
| 117 | * windowId, preferring the stable key over the legacy integer. |
| 118 | */ |
| 119 | [[nodiscard]] static int resolveSavedWindowId(const QJsonObject& entry, |
| 120 | const QHash<StableKey, int>& lookup, |
| 121 | const QMap<int, QQuickItem*>& liveWindows) |
| 122 | { |
| 123 | const StableKey key = readStableKey(entry); |
| 124 | if (key.isValid()) { |
| 125 | const auto it = lookup.constFind(key); |
| 126 | if (it != lookup.cend()) |
| 127 | return it.value(); |
| 128 | |
| 129 | return -1; |
| 130 | } |
| 131 | |
| 132 | const int legacyId = entry.value("id").toInt(-1); |
| 133 | if (legacyId >= 0 && liveWindows.contains(legacyId)) |
| 134 | return legacyId; |
| 135 | |
| 136 | return -1; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * @brief Returns the (widgetType, relativeIndex) identity for the given live |
no test coverage detected