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

Ahmad Samir noreply at phabricator.kde.org
Mon Mar 16 09:41:52 GMT 2020


ahmadsamir added inline comments.

INLINE COMMENTS

> utils.cpp:64
> +            return append(name, QLatin1Char('(') + output->name() + QLatin1Char(')'));
>          }
>      }

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(')');

}

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/20200316/952be817/attachment.html>


More information about the Plasma-devel mailing list