Skip to content

Fix KTimeComboBox for locales with unusual characters in formats

Glen Ditchfield requested to merge gditchfield/kwidgetsaddons:fix409867 into master

KTimeComboBox creates an edit mask by replacing the AM/PM indicator in a formatted time with 'a' ("optional alphabetic") mask characters. This does not work for locales that use punctuation in the indicator, such as the current en_CA format "9:00 A.M.". This patch uses mask character 'x' ("optional non-blank").

The current fr_CA time format contains an embedded 'h': "9 h 00". 'h' is an edit mask character ("optional hexadecimal digit"), so the generated mask rejects properly-formatted times. This patch escapes all characters that are not supposed to be mask characters.

Credit to Filipus Klutiero for a detailed explanation of the errors.

BUG: 341655
BUG: 405857
BUG: 406240
BUG: 409867
BUG: 410167
BUG: 411820
BUG: 412506
BUG: 420468
Edited by Glen Ditchfield

Merge request reports