chatgui: fix scroll jump on refresh, force debounce, add DEBUG logs
- Same-channel refresh: save scroll pos in memory, restore from memory (no DB race) - Force m_readDebounce->start() after loadChannel (scrollToBottom may not trigger valueChanged) - DEBUG_DEBUG logs in updateReadPosition, saveChannelState, onMessageReceived, setChannelUnreadCount
This commit is contained in:
1 parent
0c4862c66a
commit
37c5fa5607
4 files changed
+53
-7
No files matched your search
@@ -245,11 +245,15 @@ void ChannelList::setChannelUnreadCount(const QString& channelId, int count) {
|
||||
for (int row = 0; row < m_model->rowCount(); row++) {
|
||||
QStandardItem* item = m_model->item(row);
|
||||
if (item && item->data(ChannelChannelIdRole).toString() == channelId) {
|
||||
int old = item->data(ChannelUnreadCountRole).toInt();
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "ChannelList::setChannelUnreadCount ch=%s %d->%d",
|
||||
qPrintable(channelId), old, count);
|
||||
item->setData(count, ChannelUnreadCountRole);
|
||||
emit m_model->dataChanged(m_model->index(row, 0), m_model->index(row, 0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "ChannelList::setChannelUnreadCount ch=%s not found", qPrintable(channelId));
|
||||
}
|
||||
|
||||
int ChannelList::getChannelUnreadCount(const QString& channelId) const {
|
||||
|
||||
Reference in new issue
Block a user