MPRIS control: fix instance indicator with multiple app instances
ClosedPublic

Authored by kossebau on Mar 17 2018, 1:39 PM.

Details

Summary

Not sure what operator+ overload has been used exactly for the int,
in any case it does not work as intended and needs e.g. an explicit
QString::number() invocation.

Also start with number 2 for duplicated instances.

Test Plan

Start multiple instances of an MPRIS player (e.g. Gwenview). Before the
second instance would get labelled with "Name []", with this patch it is
labelled with "Name [2]".

Diff Detail

Repository
R224 KDE Connect
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau requested review of this revision.Mar 17 2018, 1:39 PM
kossebau created this revision.

While looking as this: perhaps it make sense to also switch to use "<#>" instead of "[#]", like known e.g. from KWin? Is there any standard for such instance label numbering?

I guess <> makes sense. I dont't know if there is a standard for this (maybe ask VDG ), but feel free to go ahead with <>

mtijink accepted this revision.Mar 17 2018, 7:36 PM
mtijink added a subscriber: mtijink.

Patch looks good. Another option is (2), as used for files.

This revision is now accepted and ready to land.Mar 17 2018, 7:36 PM

Too many choices. Keeping [] for now :) Thanks for reviews!

This revision was automatically updated to reflect the committed changes.