[plasma/plasma-workspace] kcms/fonts/ui: kcms/fonts: Fix "Display" font warning getting stuck
Ian Mad <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit b52b2e26bdfe85fd7ac6423688662f0a6a1a2c86 by Ian Mad.
Committed on 03/08/2026 at 09:34.
Pushed by ngraham into branch 'master'.
kcms/fonts: Fix "Display" font warning getting stuck
usingDisplayFont was built with Array.find(), which returns the matching
family-name string or undefined instead of a boolean. When a font whose
family does not contain "Display" is selected, the binding re-evaluates
to undefined; QML cannot assign that to the bool property, logs "Unable
to assign [undefined] to bool", and keeps the previous value. The warning
therefore stays visible even after switching to a non-Display font.
Use Array.some() instead, which always returns a boolean, so the property
correctly flips back to false when no configured family contains
"Display".
M +1 -1 kcms/fonts/ui/main.qml
https://invent.kde.org/plasma/plasma-workspace/-/commit/b52b2e26bdfe85fd7ac6423688662f0a6a1a2c86
diff --git a/kcms/fonts/ui/main.qml b/kcms/fonts/ui/main.qml
index 2bdaf4937d..7ffa9ec660 100644
--- a/kcms/fonts/ui/main.qml
+++ b/kcms/fonts/ui/main.qml
@@ -36,7 +36,7 @@ KCM.SimpleKCM {
smallFontWidget.font.family,
toolbarFontWidget.font.family,
menuFontWidget.font.family
- ].find(a => a.includes("Display") || a.includes(i18nc("Sub-string in a font name; 'Display' as in display font — a type of font inappropriate for computer screens", "Display")))
+ ].some(a => a.includes("Display") || a.includes(i18nc("Sub-string in a font name; 'Display' as in display font — a type of font inappropriate for computer screens", "Display")))
Kirigami.Action {
id: kscreenAction