Add qml test for chatdocumenthandler

This commit is contained in:
James Graham
2025-12-22 13:39:28 +00:00
parent 4db1e1c437
commit aadc441686
6 changed files with 74 additions and 34 deletions

View File

@@ -1033,25 +1033,6 @@ void ChatDocumentHandler::setStyleFormat(RichFormat::Format format)
Q_EMIT styleChanged();
}
QString ChatDocumentHandler::fileName() const
{
const QString filePath = QQmlFile::urlToLocalFileOrQrc(m_fileUrl);
const QString fileName = QFileInfo(filePath).fileName();
if (fileName.isEmpty())
return QStringLiteral("untitled.txt");
return fileName;
}
QString ChatDocumentHandler::fileType() const
{
return QFileInfo(fileName()).suffix();
}
QUrl ChatDocumentHandler::fileUrl() const
{
return m_fileUrl;
}
void ChatDocumentHandler::tab()
{
QTextCursor cursor = textCursor();