| 553 | } |
| 554 | |
| 555 | void ChatRootView::loadHistory(const QString &filePath) |
| 556 | { |
| 557 | if (filePath != m_recentFilePath) { |
| 558 | if (auto registry = sessionFileRegistry(); registry && registry->isLocked(filePath)) { |
| 559 | m_lastErrorMessage |
| 560 | = tr("This chat is already open in another QodeAssist chat session."); |
| 561 | emit lastErrorMessageChanged(); |
| 562 | return; |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | auto result = m_historyStore->load(filePath); |
| 567 | if (!result.success) { |
| 568 | LOG_MESSAGE(QString("Failed to load chat history: %1").arg(result.errorMessage)); |
| 569 | } else { |
| 570 | setRecentFilePath(filePath); |
| 571 | } |
| 572 | |
| 573 | if (!m_pendingSend.active) |
| 574 | m_fileManager->clearIntermediateStorage(); |
| 575 | m_attachmentFiles.clear(); |
| 576 | m_linkedFiles.clear(); |
| 577 | emit attachmentFilesChanged(); |
| 578 | emit linkedFilesChanged(); |
| 579 | |
| 580 | m_fileEditController->clearCurrentRequestId(); |
| 581 | updateInputTokensCount(); |
| 582 | } |
| 583 | |
| 584 | void ChatRootView::showSaveDialog() |
| 585 | { |
nothing calls this directly
no test coverage detected