* @brief Closes the active database, cancels any pending load, restores prior state. */
| 279 | * @brief Closes the active database, cancels any pending load, restores prior state. |
| 280 | */ |
| 281 | void 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). |
nothing calls this directly
no test coverage detected