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
@@ -327,14 +327,17 @@ void MainWindow::showSettings() {
|
||||
}
|
||||
|
||||
void MainWindow::onMessageReceived(const char* ch_id) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "MainWindow: msg received ch=%s", ch_id);
|
||||
SoundManager::instance()->play("msg_incoming");
|
||||
QString cid = QString::fromUtf8(ch_id);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "MainWindow::onMessageReceived ch=%s cur=%s",
|
||||
qPrintable(cid), qPrintable(m_currentChannelId));
|
||||
SoundManager::instance()->play("msg_incoming");
|
||||
if (m_messageList) {
|
||||
if (cid == m_currentChannelId) {
|
||||
m_messageList->refresh();
|
||||
} else if (m_channelList) {
|
||||
int unread = m_channelList->getChannelUnreadCount(cid) + 1;
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "MainWindow::onMessageReceived increment unread ch=%s %d->%d",
|
||||
qPrintable(cid), unread - 1, unread);
|
||||
m_channelList->setChannelUnreadCount(cid, unread);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user