Speed up initial load a bit

This commit is contained in:
Nicolas Werner 2020-05-03 22:30:51 +02:00
parent ccd55c70df
commit 0c73c74574

View file

@ -160,7 +160,12 @@ RoomList::initialize(const QMap<QString, RoomInfo> &info)
rooms_.clear(); rooms_.clear();
// prevent flickering and save time sorting over and over again
setUpdatesEnabled(false); setUpdatesEnabled(false);
disconnect(settings.data(),
&UserSettings::roomSortingChanged,
this,
&RoomList::sortRoomsByLastMessage);
for (auto it = info.begin(); it != info.end(); it++) { for (auto it = info.begin(); it != info.end(); it++) {
if (it.value().is_invite) if (it.value().is_invite)
@ -172,6 +177,10 @@ RoomList::initialize(const QMap<QString, RoomInfo> &info)
for (auto it = info.begin(); it != info.end(); it++) for (auto it = info.begin(); it != info.end(); it++)
updateRoomDescription(it.key(), it.value().msgInfo); updateRoomDescription(it.key(), it.value().msgInfo);
connect(settings.data(),
&UserSettings::roomSortingChanged,
this,
&RoomList::sortRoomsByLastMessage);
setUpdatesEnabled(true); setUpdatesEnabled(true);
if (rooms_.empty()) if (rooms_.empty())