MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / onProjectLoaded

Method onProjectLoaded

app/src/AppState.cpp:184–205  ·  view source on GitHub ↗

* @brief Synchronises all state after a project load or clear. */

Source from the content-addressed store, hash-verified

182 * @brief Synchronises all state after a project load or clear.
183 */
184void 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.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
syncFromProjectModelMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected