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

Method restorePreSessionState

app/src/Sessions/Player.cpp:564–580  ·  view source on GitHub ↗

* @brief Restores the operation mode and project captured before the session. */

Source from the content-addressed store, hash-verified

562 * @brief Restores the operation mode and project captured before the session.
563 */
564void Sessions::Player::restorePreSessionState()
565{
566 if (!m_preSessionCaptured)
567 return;
568
569 auto& pm = DataModel::ProjectModel::instance();
570 if (!m_preSessionProjectPath.isEmpty() && QFileInfo::exists(m_preSessionProjectPath))
571 (void)pm.openJsonFile(m_preSessionProjectPath);
572 else
573 pm.newJsonFile();
574
575 AppState::instance().setOperationMode(m_preSessionOperationMode);
576
577 m_preSessionCaptured = false;
578 m_preSessionProjectPath.clear();
579 m_preSessionOperationMode = SerialStudio::QuickPlot;
580}
581
582/**
583 * @brief Loads the project JSON shipped by the worker.

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.80
openJsonFileMethod · 0.80
newJsonFileMethod · 0.80
setOperationModeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected