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

Method workspaceModel

app/src/UI/Taskbar.cpp:1406–1423  ·  view source on GitHub ↗

* @brief Returns the workspace model for the workspace selector. */

Source from the content-addressed store, hash-verified

1404 * @brief Returns the workspace model for the workspace selector.
1405 */
1406QVariantList UI::Taskbar::workspaceModel() const
1407{
1408 const auto& pm = DataModel::ProjectModel::instance();
1409 QVariantList model;
1410 const auto& workspaces = pm.activeWorkspaces();
1411 for (const auto& ws : workspaces) {
1412 QVariantMap entry;
1413 const auto icon = ws.icon.isEmpty() ? QStringLiteral("qrc:/icons/dashboard-small/workspace.svg")
1414 : Misc::IconEngine::resolveActionIconSource(ws.icon);
1415 entry[QStringLiteral("id")] = ws.workspaceId;
1416 entry[QStringLiteral("text")] = ws.title;
1417 entry[QStringLiteral("separator")] = false;
1418 entry[QStringLiteral("icon")] = icon;
1419 model.append(entry);
1420 }
1421
1422 return model;
1423}
1424
1425/**
1426 * @brief Recursively builds one level of the workspace folder tree, skipping empty workspaces

Callers 2

getStatusMethod · 0.80
getGroupsMethod · 0.80

Calls 2

isEmptyMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected