* @brief Applies a group-title edit; returns false when the title is unchanged. */
| 4189 | * @brief Applies a group-title edit; returns false when the title is unchanged. |
| 4190 | */ |
| 4191 | bool DataModel::ProjectEditor::applyGroupTitleEdit(const QString& newTitle, int groupId) |
| 4192 | { |
| 4193 | if (m_selectedGroup.title == newTitle) |
| 4194 | return false; |
| 4195 | |
| 4196 | m_selectedGroup.title = newTitle; |
| 4197 | DataModel::ProjectModel::instance().updateGroup(groupId, m_selectedGroup, false); |
| 4198 | |
| 4199 | for (auto it = m_groupItems.begin(); it != m_groupItems.end(); ++it) { |
| 4200 | if (it.value().groupId != groupId) |
| 4201 | continue; |
| 4202 | |
| 4203 | auto* treeItem = it.key(); |
| 4204 | treeItem->setText(newTitle); |
| 4205 | treeItem->setData(newTitle, TreeViewText); |
| 4206 | m_groupItems[treeItem].title = newTitle; |
| 4207 | break; |
| 4208 | } |
| 4209 | |
| 4210 | Q_EMIT selectedTextChanged(); |
| 4211 | return true; |
| 4212 | } |
| 4213 | |
| 4214 | /** |
| 4215 | * @brief Re-routes the group (and its datasets) to the source at the given combobox index. |
nothing calls this directly
no test coverage detected