Stamps the per-source timeline attributes onto a doc's only , as MainWindow::appendDataSourceElement does at save time.
| 273 | // Stamps the per-source timeline attributes onto a doc's only <fileInfo>, as |
| 274 | // MainWindow::appendDataSourceElement does at save time. |
| 275 | void setTimelineState(QDomDocument& doc, qint64 offset_ns, int order) { |
| 276 | QDomElement file_info = doc.documentElement() |
| 277 | .firstChildElement(QStringLiteral("previouslyLoaded_Datafiles")) |
| 278 | .firstChildElement(QStringLiteral("fileInfo")); |
| 279 | file_info.setAttribute(QStringLiteral("display_offset_ns"), QString::number(offset_ns)); |
| 280 | file_info.setAttribute(QStringLiteral("timeline_order"), QString::number(order)); |
| 281 | } |
| 282 | |
| 283 | TEST(ExtractDataSource, TimelineStateAttributesParsed) { |
| 284 | QDomDocument doc = buildDataSourceDoc(QStringLiteral("/tmp/run.mcap")); |