D25580: [System Tray] Unified data model for System Tray items

Konrad Materka noreply at phabricator.kde.org
Tue Dec 10 21:11:09 GMT 2019


kmaterka marked 5 inline comments as done.
kmaterka added inline comments.

INLINE COMMENTS

> nicolasfella wrote in ConfigEntries.qml:68
> You can try doing
> 
>   for (item of systemTrayModel) {
>   ]
> 
> But I don't know if that will work

Unfortunately model is not iterable. This code will be removed in D22176 <https://phabricator.kde.org/D22176> anyway.

> nicolasfella wrote in systemtraymodel.cpp:60
> roles.insert(ItemType, ...) should be enough

I'm using `enum class` instead of simple `enum`, so explicit cast is required.

> nicolasfella wrote in systemtraymodel.cpp:74
> This could be a candidate for std::find_if

It would be nice, but does QStandardItemModel have an iterator?

> nicolasfella wrote in systemtraymodel.cpp:153
> if (contains) {
> 
>   return stuff
> 
> }
> 
> otherStuff()

OK, changed.

> nicolasfella wrote in systemtraymodel.h:77
> What's the purpose of the *Changed roles?

All of these roles are copied from StatusNotifierItemSource. It might be an overkill to support all.
I don't know exactly what was the intention to use "*Changed" roles, there is only one comment: `// record what has changed`. I found usages in old KDE4 code:

> ./kde4/kde-workspace/plasma-workspace/applets/systemtray/plugin/protocols/dbussystemtray/dbussystemtraytask.cpp



  void DBusSystemTrayTask::dataUpdated(const QString &taskName, const Plasma::DataEngine::Data &properties)
  {
      // ....
      if (properties["TitleChanged"].toBool() || becomeValid) {
          QString title = properties["Title"].toString();
          // ...
      }
      // ...

REPOSITORY
  R120 Plasma Workspace

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

To: kmaterka, #plasma, broulik, ngraham
Cc: plasma-devel, nicolasfella, anthonyfieroni, LeGast00n, The-Feren-OS-Dev, jraleigh, 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/20191210/3c7c6530/attachment-0001.html>


More information about the Plasma-devel mailing list