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

Method computeChatTitle

ChatView/ChatRootView.cpp:891–909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891QString ChatRootView::computeChatTitle() const
892{
893 if (!m_chatModel)
894 return {};
895 const auto history = m_chatModel->getChatHistory();
896 for (const auto &msg : history) {
897 if (msg.role != ChatModel::User)
898 continue;
899 const QString content = msg.content.trimmed();
900 if (content.isEmpty())
901 continue;
902 const QString firstLine = content.section(QChar('\n'), 0, 0).trimmed();
903 constexpr int maxLen = 60;
904 if (firstLine.length() > maxLen)
905 return firstLine.left(maxLen - 1) + QChar(0x2026);
906 return firstLine;
907 }
908 return {};
909}
910
911void ChatRootView::handOffSession()
912{

Callers

nothing calls this directly

Calls 2

getChatHistoryMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected