mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Speed up initial load a bit
This commit is contained in:
parent
ccd55c70df
commit
0c73c74574
1 changed files with 9 additions and 0 deletions
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue