D27675: feat: avoid duplicated text when assembling user-facing output names

Daniel Vrátil noreply at phabricator.kde.org
Tue Mar 17 14:17:46 GMT 2020


dvratil added a comment.


  The system makes sense on X11 where you get something like `HDMI-1 (Sony GigaTV-12345)` so you see which device it is and what physical output it's connected to. Since KWin does not use to output names but only the names of the actually connected devices, the needed behavior is different.

INLINE COMMENTS

> ahmadsamir wrote in utils.cpp:64
> If I am reading this correctly, you could keep the old code and use simplified():
> const QString outName = output->name().simplified();
> 
> then later on:
> name = name.simplified();
> if (!name.isEmpty() && name != oName) {
> 
>   return name + QLatin1Char('(') + outName + QLatin1Char(')');
> 
> }

Not really, the catch is in the whitespace at the end of `name` (then `"Vendor Model " == "Vendor Model"` is never true)

REPOSITORY
  R104 KScreen

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

To: dvratil, #plasma, romangg
Cc: ahmadsamir, romangg, 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200317/3926ebad/attachment.html>


More information about the Plasma-devel mailing list