chatgui: fix dual selection highlight and missing online count
- channellist.cpp: selectionChanged guard now checks currentIndex().row() is within model->rowCount() to avoid re-selecting stale index after model clear, which caused both channels to stay blue when switching. - chat_sync.c: cs_refresh_channels now posts CHANNEL_PEERS_ONLINE for all channels after loading, fixing online count showing only on the last connected group.
This commit is contained in:
1 parent
cbd9536a28
commit
4ec930c8f0
2 files changed
+5
-1
No files matched your search
@@ -56,7 +56,8 @@ protected:
|
||||
}
|
||||
void selectionChanged(const QItemSelection& sel, const QItemSelection& desel) override {
|
||||
QListView::selectionChanged(sel, desel);
|
||||
if (selectionModel() && !selectionModel()->hasSelection() && currentIndex().isValid())
|
||||
if (selectionModel() && !selectionModel()->hasSelection() && currentIndex().isValid()
|
||||
&& currentIndex().row() < model()->rowCount())
|
||||
selectionModel()->select(currentIndex(), QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
|
||||
|
||||
@@ -508,6 +508,9 @@ static void cs_refresh_channels(struct chat_sync* cs) {
|
||||
memcpy(&cs->channels[i].peer_ids[j], peer_buf + 2 + j * 8, 8);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < cs->channel_count; i++)
|
||||
cs_post_channel_online(cs, cs->channels[i].channel_id);
|
||||
}
|
||||
|
||||
static void refresh_timer_cb(void* arg) {
|
||||
|
||||
Reference in new issue
Block a user