D26850: [SystemTray] Refresh icon in settings on update

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Jan 23 15:50:10 GMT 2020


broulik added inline comments.

INLINE COMMENTS

> systemtraymodel.cpp:269
> +    QHash<int, QByteArray> roleNames = sourceModel->roleNames();
> +    for (const int key : roleNames.keys()) {
> +        if (!m_roleNames.contains(key)) {

Avoid `keys()` which creates a temporary list, instead use iterators

  const auto roleNames = sourceModel->roleNames();
  for (auto it = roleNames.begin(), end = roleNames.end(); it != end; ++it) {
      if (!m_roleNames.contains(it.key()) {
          m_roleNames.insert(it.key(), it.value());
      }
  }

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D26850

To: kmaterka, #plasma_workspaces, #plasma, davidedmundson, ngraham, broulik
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200123/edbe5bcf/attachment-0001.html>


More information about the Plasma-devel mailing list