D27675: feat: avoid duplicated text when assembling user-facing output names
Roman Gilg
noreply at phabricator.kde.org
Sun Mar 8 20:30:58 GMT 2020
romangg requested changes to this revision.
romangg added a comment.
This revision now requires changes to proceed.
Ok, I see the issue. The question is if `Vendor Model` is not a bit stupid as a name for an output and if KWin/KWayland should not be a bit more intelligent about choosing a name. Then it could make sense again to have `(Vendor model)` appended afterwards. For example I have here a monitor for testing which is called on the website: PROLITE XUB2395WSU-B1. But KWin returns as Vendor "IVM" and as name "DP-1-PL2395W/11638JJ60250".
INLINE COMMENTS
> utils.cpp:36
> {
> + const auto append = [](const QString &a, const QString &b) -> QString {
> + const auto s = b.trimmed();
Please don't use single character variable names. Also can this be made more explicit? I can't guess directly what the meaning of a, b and s is. I don't think it is that generic, is it?
> utils.cpp:61
> }
> - if (!name.trimmed().isEmpty()) {
> - return name + QLatin1Char('(') + output->name() + QLatin1Char(')');
> + // Don't append (ConnectorName) if its the same as "VendorName ModelName"
> + if (!name.isEmpty() && name != output->name()) {
Full-stop in the end.
REPOSITORY
R104 KScreen
REVISION DETAIL
https://phabricator.kde.org/D27675
To: dvratil, #plasma, romangg
Cc: 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/20200308/33e10920/attachment.html>
More information about the Plasma-devel
mailing list