MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / populateTaskbarFromWorkspace

Method populateTaskbarFromWorkspace

app/src/UI/Taskbar.cpp:445–469  ·  view source on GitHub ↗

* @brief Populates the taskbar buttons for a user-defined workspace (id >= 1000). */

Source from the content-addressed store, hash-verified

443 * @brief Populates the taskbar buttons for a user-defined workspace (id >= 1000).
444 */
445void 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).

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.80
groupIdForUniqueIdMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected