<div>markg added inline comments.</div><br /><div><strong>INLINE COMMENTS</strong><div><div>src/context.cpp:424 You can merge this one and the earlier isNew i think.<br />
<br />
Something like:<br />
<br />
```<br />
auto result = m_sinkInputs.data().constFind(eventRoleIndex); <br />
<br />
if (result == m_sinkInputs.data().constEnd()) {<br />
emit m_sinkInputs.added(... something ...);<br />
} else {<br />
emit m_sinkInputs.updated(result.value() .. or something like it);<br />
}<br />
```<br />
<br />
You have to change it obviously, but you can make it nicer by using constFind</div><div>src/kcm/package/contents/ui/StreamListItem.qml:57-65 Just a preference, feel free to ignore.<br />
Can you try to make get this text value from the C++ side instead of if/elseif/else in QML.. Would be cleaner.<br />
<br />
In fact, you might be able to tweak PulseObject.name and and just use that as text.</div><div>src/maps.h:67 This isn't a neat way.<br />
<br />
You're returning the data in a writeable way so that you can add items later on. I think it would be cleaner and better if you simply add an "insertEntry" function (just like you already have an updateEntry and a removeEntry). Then use the new "insertEntry" where you use this data() method instead.</div><div>src/maps.h:75-78 Big pros if you rewrite this to a:<br />
<br />
<br />
```<br />
auto result = m_data.constFind(t);<br />
<br />
if (result != m_data.constEnd()) {<br />
return result.value();<br />
} else {<br />
return -1;<br />
}<br />
```<br />
<br />
Or something alike. My example probably doesn't work _exactly_ like that ;)</div><div>src/maps.h:158 Massive +1 (i know you didn't touch this here.. just commenting on it since i'm reading the code now).<br />
<br />
If you transform this into smart pointers you save quite some code within the removeEntry and the reset method. And you prevent accidental "oops, forgot to delete the object" mistakes (aka, memory leaks).<br />
<br />
Note: that could also make m_pendingRemovals redundant. But you would have to test that.</div></div></div><br /><div><strong>REPOSITORY</strong><div><div>rPLASMAPA Plasma Audio Volume Applet</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D1366" rel="noreferrer">https://phabricator.kde.org/D1366</a></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>drosca, Plasma, Plasma: Design<br /><strong>Cc: </strong>markg, broulik, colomar, plasma-devel, sebas<br /></div>