broulik added a comment.
+1 I've been wanting to do exactly this forever INLINE COMMENTS > notification.cpp:431 > + > + if (m_notifications.contains(connectionId)) { > + notify = m_notifications[connectionId]; Avoid double look-up. `QHash` gives you a null value when not existing, so you can do: KNotification *notify = m_notifications.value(connectionId); if (!notify) { notify = new KNotification(...); ... m_notifications.insert(connectionId, notify); } REPOSITORY R116 Plasma Network Management Applet BRANCH reuse REVISION DETAIL https://phabricator.kde.org/D28693 To: nicolasfella, #plasma, broulik, jgrulich Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart