* @brief Populates the taskbar buttons for a user-defined workspace (id >= 1000). */
| 443 | * @brief Populates the taskbar buttons for a user-defined workspace (id >= 1000). |
| 444 | */ |
| 445 | void UI::Taskbar::populateTaskbarFromWorkspace(int groupId) |
| 446 | { |
| 447 | const auto& workspaces = DataModel::ProjectModel::instance().activeWorkspaces(); |
| 448 | for (const auto& ws : workspaces) { |
| 449 | if (ws.workspaceId != groupId) |
| 450 | continue; |
| 451 | |
| 452 | for (const auto& ref : ws.widgetRefs) { |
| 453 | const int windowId = findWindowIdByGroupAndIndex(ref.widgetType, ref.relativeIndex); |
| 454 | if (windowId < 0) |
| 455 | continue; |
| 456 | |
| 457 | const int refGid = UI::Dashboard::instance().groupIdForUniqueId(ref.groupUniqueId); |
| 458 | auto* item = findItemByWindowId(windowId); |
| 459 | if (!item || item->data(TaskbarModel::GroupIdRole).toInt() != refGid) |
| 460 | continue; |
| 461 | |
| 462 | auto* clone = item->clone(); |
| 463 | setWindowState(windowId, TaskbarModel::WindowNormal); |
| 464 | m_taskbarButtons->appendRow(clone); |
| 465 | } |
| 466 | |
| 467 | return; |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | /** |
| 472 | * @brief Populates the taskbar buttons for an auto-generated group (id < 1000). |
nothing calls this directly
no test coverage detected