* @brief Deletes a chat's snapshot file and index entry. */
| 212 | * @brief Deletes a chat's snapshot file and index entry. |
| 213 | */ |
| 214 | void AI::ChatStore::removeChat(const QString& id) |
| 215 | { |
| 216 | const int idx = indexOf(id); |
| 217 | if (idx < 0) |
| 218 | return; |
| 219 | |
| 220 | QFile::remove(chatPath(id)); |
| 221 | m_chats.removeAt(idx); |
| 222 | if (m_lastActive == id) |
| 223 | m_lastActive.clear(); |
| 224 | |
| 225 | writeIndex(); |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * @brief Overrides a chat's display title. |