* @brief Sets the active group based on its index in the group model. */
| 550 | * @brief Sets the active group based on its index in the group model. |
| 551 | */ |
| 552 | void UI::Taskbar::setActiveGroupIndex(int index) |
| 553 | { |
| 554 | auto model = workspaceModel(); |
| 555 | if (model.count() > index && index >= 0) { |
| 556 | auto item = model[index]; |
| 557 | auto map = item.toMap(); |
| 558 | auto id = map.value("id", -1).toInt(); |
| 559 | if (m_independentWorkspace && id >= 0) |
| 560 | m_desiredGroupId = id; |
| 561 | |
| 562 | setActiveGroupId(id); |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | /** |
| 567 | * @brief Activates a workspace by id (used by the folder switcher sub-menus). |