| 49 | } |
| 50 | |
| 51 | QString ChatHistoryStore::suggestedFileName() const |
| 52 | { |
| 53 | QString shortMessage; |
| 54 | |
| 55 | if (m_chatModel->rowCount() > 0) { |
| 56 | QString firstMessage |
| 57 | = m_chatModel->data(m_chatModel->index(0), ChatModel::Content).toString(); |
| 58 | shortMessage = firstMessage.split('\n').first().simplified().left(30); |
| 59 | |
| 60 | if (shortMessage.isEmpty()) { |
| 61 | QVariantList images |
| 62 | = m_chatModel->data(m_chatModel->index(0), ChatModel::Images).toList(); |
| 63 | if (!images.isEmpty()) { |
| 64 | shortMessage = "image_chat"; |
| 65 | } |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return generateChatFileName(shortMessage, historyDir()); |
| 70 | } |
| 71 | |
| 72 | QString ChatHistoryStore::autosaveFilePath(const QString &recentFilePath) const |
| 73 | { |