* @brief Returns the workspace-model index of the active group, or -1 when none matches. */
| 162 | * @brief Returns the workspace-model index of the active group, or -1 when none matches. |
| 163 | */ |
| 164 | int UI::Taskbar::activeGroupIndex() const |
| 165 | { |
| 166 | const auto model = workspaceModel(); |
| 167 | int index = 0; |
| 168 | for (auto it = model.begin(); it != model.end(); ++it) { |
| 169 | const auto map = it->toMap(); |
| 170 | if (!map.contains(QStringLiteral("id"))) |
| 171 | continue; |
| 172 | |
| 173 | if (map.value(QStringLiteral("id")).toInt() == m_activeGroupId) |
| 174 | return index; |
| 175 | |
| 176 | ++index; |
| 177 | } |
| 178 | |
| 179 | return -1; |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * @brief Returns whether this taskbar tracks its own workspace independently of the project. |