| 216 | } |
| 217 | |
| 218 | ThreadChatBarModel::ThreadChatBarModel(QObject *parent, NeoChatRoom *room) |
| 219 | : QAbstractListModel(parent) |
| 220 | , m_room(room) |
| 221 | { |
| 222 | if (m_room != nullptr) { |
| 223 | connect(m_room->threadCache(), &ChatBarCache::threadIdChanged, this, [this](const QString &oldThreadId, const QString &newThreadId) { |
| 224 | const auto threadModel = dynamic_cast<ThreadModel *>(this->parent()); |
| 225 | if (threadModel != nullptr && (oldThreadId == threadModel->threadRootId() || newThreadId == threadModel->threadRootId())) { |
| 226 | beginResetModel(); |
| 227 | endResetModel(); |
| 228 | } |
| 229 | }); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | QVariant ThreadChatBarModel::data(const QModelIndex &idx, int role) const |
| 234 | { |
nothing calls this directly
no test coverage detected