[UserList] Bulk load to prevent hang on connect, fix multi-monitor positioning (#7087)

* [UserList] Bulk load to prevent hang on connect, fix multi-monitor positioning

Took 48 minutes

* Extract slot to method

Took 10 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-08-10 22:11:14 +02:00 committed by GitHub
parent 42f890ea7c
commit bfdb9b0f1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 102 additions and 22 deletions

View file

@ -135,6 +135,7 @@ void TabAccount::retranslateUi()
void TabAccount::processListUsersResponse(const Response &response)
{
const Response_ListUsers &resp = response.GetExtension(Response_ListUsers::ext);
allUsersList->beginBulkLoad();
for (int i = 0; i < resp.user_list_size(); ++i) {
const ServerInfo_User &info = resp.user_list(i);
const QString &userName = QString::fromStdString(info.name());
@ -142,8 +143,8 @@ void TabAccount::processListUsersResponse(const Response &response)
ignoreList->setUserOnline(userName, true);
buddyList->setUserOnline(userName, true);
}
allUsersList->endBulkLoad();
allUsersList->sortItems();
ignoreList->sortItems();
buddyList->sortItems();
}
@ -188,18 +189,20 @@ void TabAccount::processUserLeftEvent(const Event_UserLeft &event)
void TabAccount::buddyListReceived(const QList<ServerInfo_User> &_buddyList)
{
buddyList->beginBulkLoad();
for (const auto &user : _buddyList) {
buddyList->processUserInfo(user, false);
}
buddyList->sortItems();
buddyList->endBulkLoad();
}
void TabAccount::ignoreListReceived(const QList<ServerInfo_User> &_ignoreList)
{
ignoreList->beginBulkLoad();
for (const auto &user : _ignoreList) {
ignoreList->processUserInfo(user, false);
}
ignoreList->sortItems();
ignoreList->endBulkLoad();
}
void TabAccount::processAddToListEvent(const Event_AddToList &event)