mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-23 19:51:05 -04:00
* refactor: Migrate tests to Qt Creator plugin framework and update llmqore transports * refactor: Move conversation history into IDE-free session library * refactor: Extract turn context assembly behind injected ports * build: Add RunQodeAssistTests target for the plugin test suite * refactor: Route the chat through a Session and ChatBackend seam
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Copyright (C) 2024-2026 Petr Mironychev
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QPointer>
|
|
#include <QString>
|
|
|
|
#include "ChatSerializer.hpp"
|
|
|
|
namespace QodeAssist::Session {
|
|
class Session;
|
|
}
|
|
|
|
namespace QodeAssist::Chat {
|
|
|
|
class ChatHistoryStore : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ChatHistoryStore(Session::Session *session, QObject *parent = nullptr);
|
|
|
|
QString historyDir() const;
|
|
QString suggestedFileName() const;
|
|
QString autosaveFilePath(const QString &recentFilePath) const;
|
|
QString autosaveFilePath(
|
|
const QString &recentFilePath,
|
|
const QString &firstMessage,
|
|
bool hasImageAttachments) const;
|
|
|
|
SerializationResult save(const QString &filePath) const;
|
|
SerializationResult load(const QString &filePath) const;
|
|
|
|
void showSaveDialog();
|
|
void showLoadDialog();
|
|
void openHistoryFolder() const;
|
|
|
|
signals:
|
|
void saveRequested(const QString &filePath);
|
|
void loadRequested(const QString &filePath);
|
|
|
|
private:
|
|
QString generateChatFileName(const QString &shortMessage, const QString &dir) const;
|
|
|
|
QPointer<Session::Session> m_session;
|
|
};
|
|
|
|
} // namespace QodeAssist::Chat
|