mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-30 22:43:00 -05:00
refactor: Reworking attaching files (#280)
chore: Upgrade chat format version
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user