* @brief Synchronises all state after a project load or clear. */
| 182 | * @brief Synchronises all state after a project load or clear. |
| 183 | */ |
| 184 | void AppState::onProjectLoaded() |
| 185 | { |
| 186 | const QString path = DataModel::ProjectModel::instance().jsonFilePath(); |
| 187 | if (!m_demoSessionDir.isEmpty() && !QDir::cleanPath(path).startsWith(m_demoSessionDir)) { |
| 188 | m_demoSessionDir.clear(); |
| 189 | if (!m_ephemeralSession) |
| 190 | m_settings.setValue("operation_mode", static_cast<int>(m_operationMode)); |
| 191 | } |
| 192 | |
| 193 | if (m_projectFilePath != path) { |
| 194 | m_projectFilePath = path; |
| 195 | if (!m_ephemeralSession && m_demoSessionDir.isEmpty()) |
| 196 | m_settings.setValue("project_file_path", path); |
| 197 | |
| 198 | Q_EMIT projectFileChanged(); |
| 199 | } |
| 200 | |
| 201 | DataModel::FrameBuilder::instance().syncFromProjectModel(); |
| 202 | |
| 203 | m_frameConfig = deriveFrameConfig(); |
| 204 | Q_EMIT frameConfigChanged(m_frameConfig); |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * @brief Clears the stored project file path and notifies listeners. |
nothing calls this directly
no test coverage detected