| 304 | } |
| 305 | |
| 306 | QString ChatSerializer::loadContentFromStorage(const QString &chatFilePath, const QString &storedPath) |
| 307 | { |
| 308 | QString contentFolder = getChatContentFolder(chatFilePath); |
| 309 | QString fullPath = QDir(contentFolder).filePath(storedPath); |
| 310 | |
| 311 | QFile file(fullPath); |
| 312 | if (!file.open(QIODevice::ReadOnly)) { |
| 313 | LOG_MESSAGE(QString("Failed to open content file: %1").arg(fullPath)); |
| 314 | return QString(); |
| 315 | } |
| 316 | |
| 317 | QByteArray contentData = file.readAll(); |
| 318 | file.close(); |
| 319 | |
| 320 | return contentData.toBase64(); |
| 321 | } |
| 322 | |
| 323 | } // namespace QodeAssist::Chat |