From 3d93ed94b02cd332c3c5e8c75a535cdcb05d7cd2 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 16 Jan 2023 01:16:41 -0600 Subject: [PATCH] Fix channel msg count to display updates --- src/channelmodel.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/channelmodel.cpp b/src/channelmodel.cpp index 1860933..1d9b45b 100644 --- a/src/channelmodel.cpp +++ b/src/channelmodel.cpp @@ -147,10 +147,6 @@ Channel *ChannelModel::createChannel(Channel *ch, const QStringList &name, int i child = (*ch->children.emplace(insertPt, ox::make_unique(childId, ch))).get(); m_procData->channels[childId].channel = child; endInsertRows(); - //ch->children.empty - //std::sort(ch->children.begin(), ch->children.end(), [](const auto &a, const auto &b) { - // return a->name() < b->name(); - //}); } return createChannel(child, name, it + 1); } @@ -160,7 +156,10 @@ void ChannelModel::addChannel(ChId chId) { } void ChannelModel::incChannel(ChId chId) { - ++m_procData->channels[chId].channel->msgCnt; + auto ch = m_procData->channels[chId].channel; + ++ch->msgCnt; + const auto idx = createIndex(ch->row(), 0, ch); + emit dataChanged({}, idx); } void ChannelModel::setProcessData(ProcessData *data) {