more creative output type detection in xrandr backend
ClosedPublic

Authored by sebas on Jun 14 2016, 1:20 AM.

Details

Summary

Many users report Unknown output types, while the reported output names
are more reliable. This patch makes the code fall back to the name-based
detection code (which was there already anyway, but hardly used).

I've removed one private static method, since this was only called from
one place and moving this logic into the method where the rest of the
string detection happens makes the code more readable.

The "panel" detection still plays a bit of a special role, this matches
the previous behavior, which I really don't want to change.

Also, "DP<something>" is commonly used for displayport connectors, so
match that as well.

CCBUG:364044

Diff Detail

Repository
R110 KScreen Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sebas updated this revision to Diff 4426.Jun 14 2016, 1:20 AM
sebas retitled this revision from to more creative output type detection in xrandr backend.
sebas updated this object.
sebas edited the test plan for this revision. (Show Details)
sebas added reviewers: Plasma, dvratil.
Restricted Application added a project: Plasma. · View Herald TranscriptJun 14 2016, 1:20 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas updated this revision to Diff 4427.Jun 14 2016, 1:35 AM
  • Fix TV detection

The more specific tv types could never be reached, so fix detection order so specific
TV flavours are preferred over the general TV case.

I assume we don't have any chance to autotest this, right?

backends/xrandr/xrandroutput.cpp
253

sure you want to use a QStringList? It looks to me like you wanted to have them as QLatin1Strings for the startsWith check. But that doesn't work when converted to QString. So maybe QVector<QLatin1String>?

253–256
static const QStringList embedded{QStringLiteral{"LVDS"}, QStringLiteral{"IDP"}};

and so on. This turns the initialization into compile time instead of runtime where multiple elements are added.

dvratil accepted this revision.Jun 14 2016, 7:06 AM
dvratil edited edge metadata.

Good idea with the fallback.

This revision is now accepted and ready to land.Jun 14 2016, 7:06 AM
broulik added inline comments.
backends/xrandr/xrandroutput.cpp
258

range for, embedded is const

sebas added inline comments.Jun 14 2016, 12:34 PM
backends/xrandr/xrandroutput.cpp
253

This code is copied, I left it as-is, just moved it around.

I'll fix the issues with the existing code separately.

This revision was automatically updated to reflect the committed changes.