Bug 407999 - Fragile comparison to i18n("None")
Summary: Fragile comparison to i18n("None")
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kdeclarative
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.58.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-27 13:42 UTC by Alexander Potashev
Modified: 2019-06-14 16:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.60.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2019-05-27 13:42:47 UTC
SUMMARY
Fragile comparison to i18n("None") in kdeclarative/src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml:108:
===
source: delegate.text === i18n("None") ? "edit-none" : "view-preview"
===

If the caller code translates "None" into the target language differently, this comparison will return false and behave not as intended. This component should probably use another boolean property to choose between these two icons, or just an "icon" property to specify a custom icon.

Please also describe this behaviour in the documentation. From the current documentation at https://api.kde.org/frameworks/kdeclarative/html/classorg_1_1kde_1_1kcm_1_1GridDelegate.html it's unclear how the component behaves and what icons it may use for what purposes.

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Björn Feber 2019-06-14 16:07:56 UTC
Git commit 43a7f102309a0aa93675c000797bdd9a434f0302 by Björn Feber.
Committed on 14/06/2019 at 16:04.
Pushed by bfeber into branch 'master'.

Fix fragile comparison to i18n("None") and describe behavior in docs
FIXED-IN: 5.60.0

M  +3    -2    src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml

https://commits.kde.org/kdeclarative/43a7f102309a0aa93675c000797bdd9a434f0302