MCPcopy Create free account
hub / github.com/KDE/neochat / ThreadChatBarModel

Method ThreadChatBarModel

src/messagecontent/models/threadmodel.cpp:218–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218ThreadChatBarModel::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
233QVariant ThreadChatBarModel::data(const QModelIndex &idx, int role) const
234{

Callers

nothing calls this directly

Calls 3

threadCacheMethod · 0.80
parentMethod · 0.45
threadRootIdMethod · 0.45

Tested by

no test coverage detected