* @brief Main-thread-only: snapshots ProjectModel into m_projectSnapshot. */
| 742 | * @brief Main-thread-only: snapshots ProjectModel into m_projectSnapshot. |
| 743 | */ |
| 744 | void Sessions::Export::refreshProjectSnapshot() |
| 745 | { |
| 746 | QByteArray payload; |
| 747 | if (AppState::instance().operationMode() == SerialStudio::ProjectFile) { |
| 748 | const auto& pm = DataModel::ProjectModel::instance(); |
| 749 | if (!pm.groups().empty()) { |
| 750 | const auto doc = QJsonDocument(pm.serializeToJson()); |
| 751 | payload = doc.toJson(QJsonDocument::Compact); |
| 752 | } |
| 753 | } |
| 754 | |
| 755 | QMutexLocker locker(&m_projectSnapshotMutex); |
| 756 | m_projectSnapshot = std::move(payload); |
| 757 | } |
| 758 | |
| 759 | /** |
| 760 | * @brief Enables or disables SQLite export. |
nothing calls this directly
no test coverage detected