| 175 | } |
| 176 | |
| 177 | QJsonObject ChatSerializer::serializeChat(const ChatModel *model, const QString &chatFilePath) |
| 178 | { |
| 179 | QJsonArray messagesArray; |
| 180 | for (const auto &message : model->getChatHistory()) { |
| 181 | messagesArray.append(serializeMessage(message, chatFilePath)); |
| 182 | } |
| 183 | |
| 184 | QJsonObject root; |
| 185 | root["version"] = VERSION; |
| 186 | root["messages"] = messagesArray; |
| 187 | |
| 188 | return root; |
| 189 | } |
| 190 | |
| 191 | bool ChatSerializer::deserializeChat( |
| 192 | ChatModel *model, const QJsonObject &json, const QString &chatFilePath) |
nothing calls this directly
no test coverage detected