MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / ChatEditor

Method ChatEditor

chat/ChatEditor.cpp:17–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace QodeAssist::Chat {
16
17ChatEditor::ChatEditor(
18 QQmlEngine *engine,
19 SessionFileRegistry *sessionFileRegistry,
20 Skills::SkillsManager *skillsManager)
21 : m_engine(engine)
22 , m_sessionFileRegistry(sessionFileRegistry)
23 , m_skillsManager(skillsManager)
24 , m_document(new ChatDocument(this))
25 , m_chatWidget(new ChatWidget(engine, sessionFileRegistry, skillsManager, false))
26{
27 setWidget(m_chatWidget);
28 setContext(Core::Context(Constants::QODE_ASSIST_CHAT_CONTEXT));
29 setDuplicateSupported(false);
30
31 if (auto rootView = qobject_cast<ChatRootView *>(m_chatWidget->rootObject())) {
32 rootView->setInEditor(true);
33 connect(
34 rootView,
35 &ChatRootView::closeHostRequested,
36 this,
37 [this] { Core::EditorManager::closeEditors({this}); },
38 Qt::QueuedConnection);
39
40 auto syncTitle = [this, rootView] {
41 const QString title = rootView->chatTitle();
42 m_document->setPreferredDisplayName(
43 title.isEmpty() ? Tr::tr("QodeAssist Chat") : QStringLiteral("QodeAssist - ") + title);
44 };
45 connect(rootView, &ChatRootView::chatTitleChanged, this, syncTitle);
46 syncTitle();
47 }
48}
49
50void ChatEditor::consumePendingChatFile()
51{

Callers

nothing calls this directly

Calls 4

ContextClass · 0.85
setInEditorMethod · 0.80
chatTitleMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected