Verified Commit fe1f7203 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

effects/outputlocator: Show connector name for monitors with identical everything

See also: kscreen!129

BUG: 450344
parent 2ebbe42a
Pipeline #230051 passed with stage
in 23 minutes and 53 seconds
......@@ -6,6 +6,7 @@
#include "outputlocator.h"
#include <algorithm>
#include <kwinoffscreenquickview.h>
#include <KLocalizedString>
......@@ -22,6 +23,9 @@ static QString outputName(const EffectScreen *screen)
const bool shouldShowSerialNumber = std::any_of(screens.cbegin(), screens.cend(), [screen](const EffectScreen *other) {
return other != screen && other->manufacturer() == screen->manufacturer() && other->model() == screen->model();
});
const bool shouldShowConnector = shouldShowSerialNumber && std::any_of(screens.cbegin(), screens.cend(), [screen](const EffectScreen *other) {
return other != screen && other->serialNumber() == screen->serialNumber();
});
QStringList parts;
if (!screen->manufacturer().isEmpty()) {
......@@ -36,6 +40,10 @@ static QString outputName(const EffectScreen *screen)
parts.append(screen->serialNumber());
}
if (shouldShowConnector) {
parts.append(screen->name());
}
if (parts.isEmpty()) {
return i18nc("@label", "Unknown");
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment