* @brief Files a workspace into folder @p parentFolderId (-1 = top level). */
| 6123 | * @brief Files a workspace into folder @p parentFolderId (-1 = top level). |
| 6124 | */ |
| 6125 | void DataModel::ProjectModel::moveWorkspaceToFolder(int workspaceId, int parentFolderId) |
| 6126 | { |
| 6127 | if (!m_customizeWorkspaces) |
| 6128 | setCustomizeWorkspaces(true); |
| 6129 | |
| 6130 | if (parentFolderId != -1 && !folderExists(m_workspaceFolders, parentFolderId)) |
| 6131 | return; |
| 6132 | |
| 6133 | for (auto& ws : m_workspaces) { |
| 6134 | if (ws.workspaceId != workspaceId) |
| 6135 | continue; |
| 6136 | |
| 6137 | if (ws.parentFolderId == parentFolderId) |
| 6138 | return; |
| 6139 | |
| 6140 | ws.parentFolderId = parentFolderId; |
| 6141 | setModified(true); |
| 6142 | Q_EMIT editorWorkspacesChanged(); |
| 6143 | Q_EMIT activeWorkspacesChanged(); |
| 6144 | return; |
| 6145 | } |
| 6146 | } |
| 6147 | |
| 6148 | /** |
| 6149 | * @brief Re-parents a folder, rejecting a cyclic move into its own subtree. |
nothing calls this directly
no test coverage detected