refactor: Reworking attaching files (#280)

chore: Upgrade chat format version
This commit is contained in:
Petr Mironychev
2025-11-28 16:17:25 +01:00
committed by GitHub
parent 22377c8f6a
commit 2d5667d8ca
8 changed files with 264 additions and 70 deletions

View File

@ -43,11 +43,17 @@ ContextManager::ContextManager(QObject *parent)
QString ContextManager::readFile(const QString &filePath) const
{
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
LOG_MESSAGE(QString("Failed to open file for reading: %1 - %2")
.arg(filePath, file.errorString()));
return QString();
}
QTextStream in(&file);
return in.readAll();
QString content = in.readAll();
file.close();
return content;
}
QList<ContentFile> ContextManager::getContentFiles(const QStringList &filePaths) const