* @brief Returns the workspace model for the workspace selector. */
| 1404 | * @brief Returns the workspace model for the workspace selector. |
| 1405 | */ |
| 1406 | QVariantList 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 |