Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Verified Commit 0d6c96df authored by Linus Jahn's avatar Linus Jahn

RosterModel: Minor clean up, Make ContactMap a QHash

QHashes are more efficient with many (20+) items, but slow with few. In
this case we probably have many items and QMap would get linearly slower
with each item.

 #ImportantCommit #VeryEssential #MakeKaidanGreatAgain #Hashtag
parent 04cebac7
Pipeline #3183 passed with stage
in 5 minutes and 11 seconds
......@@ -47,6 +47,6 @@
/**
* Map of JIDs to contact names
*/
typedef QMap<QString, QString> ContactMap;
typedef QHash<QString, QString> ContactMap;
#endif // GLOBALS_H
......@@ -222,7 +222,7 @@ void RosterModel::setLastMessage(const QString jid, QString message)
submit();
}
void RosterModel::replaceContacts(const QMap<QString, QString> contactList)
void RosterModel::replaceContacts(const ContactMap &contactList)
{
// This will first remove a list of JIDs from the DB that were deleted on
// the server, then it'll update all the nick names. This is made so
......
......@@ -57,7 +57,7 @@ signals:
void setUnreadMessageCountRequested(const QString jid, const int unreadMessageCount);
void setLastMessageRequested(const QString jid, QString message);
void newUnreadMessageRequested(const QString jid);
void replaceContactsRequested(const ContactMap contactMap);
void replaceContactsRequested(const ContactMap &contactMap);
private slots:
void clearData();
......@@ -68,7 +68,7 @@ private slots:
void setUnreadMessageCount(const QString jid, const int unreadMessageCount);
void newUnreadMessage(const QString jid);
void setLastMessage(const QString jid, QString message);
void replaceContacts(const ContactMap contactMap);
void replaceContacts(const ContactMap &contactMap);
private:
QStringList getJidList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment