* @brief Restores the operation mode and project captured before the session. */
| 562 | * @brief Restores the operation mode and project captured before the session. |
| 563 | */ |
| 564 | void 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. |
nothing calls this directly
no test coverage detected