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

Method closeFile

app/src/Sessions/Player.cpp:281–306  ·  view source on GitHub ↗

* @brief Closes the active database, cancels any pending load, restores prior state. */

Source from the content-addressed store, hash-verified

279 * @brief Closes the active database, cancels any pending load, restores prior state.
280 */
281void Sessions::Player::closeFile()
282{
283 if (m_worker)
284 m_worker->requestCancel();
285
286 const bool wasLoading = m_loading;
287
288 m_playing = false;
289 m_framePos = 0;
290 m_loading = false;
291
292 teardownLocalDb();
293 clearLocalState();
294
295 DataModel::FrameBuilder::instance().registerQuickPlotHeaders(QStringList());
296 DataModel::FrameBuilder::instance().setReplayColumnMap({});
297
298 restorePreSessionState();
299
300 if (wasLoading)
301 Q_EMIT loadingChanged();
302
303 Q_EMIT openChanged();
304 Q_EMIT timestampChanged();
305 Q_EMIT playerStateChanged();
306}
307
308/**
309 * @brief Opens @p filePath, queues an async session load (latest session).

Callers

nothing calls this directly

Calls 3

setReplayColumnMapMethod · 0.80
requestCancelMethod · 0.45

Tested by

no test coverage detected