[plasma/libkscreen] backends: fix: reorder output type detection so DVI/TV subtypes are reachable

zhang shoucheng <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit bd53adf25fcd4452dba58afd4a6e584fdaa91974 by zhang shoucheng.
Committed on 21/07/2026 at 09:21.
Pushed by zamundaaa into branch 'master'.

fix: reorder output type detection so DVI/TV subtypes are reachable

M  +4    -4    backends/fake/parser.cpp
M  +2    -2    backends/utils.cpp

https://invent.kde.org/plasma/libkscreen/-/commit/bd53adf25fcd4452dba58afd4a6e584fdaa91974

diff --git a/backends/fake/parser.cpp b/backends/fake/parser.cpp
index 05ec1c99..756994ea 100644
--- a/backends/fake/parser.cpp
+++ b/backends/fake/parser.cpp
@@ -136,20 +136,18 @@ OutputPtr Parser::outputFromJson(QMap<QString, QVariant> map)
         output->setType(Output::Panel);
     } else if (type.contains("VGA")) {
         output->setType(Output::VGA);
-    } else if (type.contains("DVI")) {
-        output->setType(Output::DVI);
     } else if (type.contains("DVI-I")) {
         output->setType(Output::DVII);
     } else if (type.contains("DVI-A")) {
         output->setType(Output::DVIA);
     } else if (type.contains("DVI-D")) {
         output->setType(Output::DVID);
+    } else if (type.contains("DVI")) {
+        output->setType(Output::DVI);
     } else if (type.contains("HDMI") || type.contains("6")) {
         output->setType(Output::HDMI);
     } else if (type.contains("Panel")) {
         output->setType(Output::Panel);
-    } else if (type.contains("TV")) {
-        output->setType(Output::TV);
     } else if (type.contains("TV-Composite")) {
         output->setType(Output::TVComposite);
     } else if (type.contains("TV-SVideo")) {
@@ -160,6 +158,8 @@ OutputPtr Parser::outputFromJson(QMap<QString, QVariant> map)
         output->setType(Output::TVSCART);
     } else if (type.contains("TV-C4")) {
         output->setType(Output::TVC4);
+    } else if (type.contains("TV")) {
+        output->setType(Output::TV);
     } else if (type.contains("DisplayPort") || type.contains("14")) {
         output->setType(Output::DisplayPort);
     } else if (type.contains("Unknown")) {
diff --git a/backends/utils.cpp b/backends/utils.cpp
index d3f08c57..991f6525 100644
--- a/backends/utils.cpp
+++ b/backends/utils.cpp
@@ -20,14 +20,14 @@ KScreen::Output::Type Utils::guessOutputType(const QString &type, const QString
 
     if (type.contains(QLatin1String("VGA"))) {
         return KScreen::Output::VGA;
-    } else if (type.contains(QLatin1String("DVI"))) {
-        return KScreen::Output::DVI;
     } else if (type.contains(QLatin1String("DVI-I"))) {
         return KScreen::Output::DVII;
     } else if (type.contains(QLatin1String("DVI-A"))) {
         return KScreen::Output::DVIA;
     } else if (type.contains(QLatin1String("DVI-D"))) {
         return KScreen::Output::DVID;
+    } else if (type.contains(QLatin1String("DVI"))) {
+        return KScreen::Output::DVI;
     } else if (type.contains(QLatin1String("HDMI"))) {
         return KScreen::Output::HDMI;
     } else if (type.contains(QLatin1String("Panel"))) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.