* @brief Returns window IDs of all widgets in the given user workspace, empty for non-user IDs. */
| 1760 | * @brief Returns window IDs of all widgets in the given user workspace, empty for non-user IDs. |
| 1761 | */ |
| 1762 | QVariantList UI::Taskbar::workspaceWidgetIds(int workspaceId) const |
| 1763 | { |
| 1764 | QVariantList ids; |
| 1765 | if (workspaceId < WorkspaceIds::AutoStart) |
| 1766 | return ids; |
| 1767 | |
| 1768 | const auto& workspaces = DataModel::ProjectModel::instance().activeWorkspaces(); |
| 1769 | for (const auto& ws : workspaces) { |
| 1770 | if (ws.workspaceId != workspaceId) |
| 1771 | continue; |
| 1772 | |
| 1773 | for (const auto& ref : ws.widgetRefs) { |
| 1774 | const int windowId = findWindowIdByGroupAndIndex(ref.widgetType, ref.relativeIndex); |
| 1775 | if (windowId < 0) |
| 1776 | continue; |
| 1777 | |
| 1778 | const int refGid = UI::Dashboard::instance().groupIdForUniqueId(ref.groupUniqueId); |
| 1779 | auto* item = findItemByWindowId(windowId); |
| 1780 | if (!item || item->data(TaskbarModel::GroupIdRole).toInt() != refGid) |
| 1781 | continue; |
| 1782 | |
| 1783 | ids.append(windowId); |
| 1784 | } |
| 1785 | |
| 1786 | break; |
| 1787 | } |
| 1788 | |
| 1789 | return ids; |
| 1790 | } |
| 1791 | |
| 1792 | /** |
| 1793 | * @brief Replaces the widget list of a user workspace with the given IDs. |
nothing calls this directly
no test coverage detected