[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2020-07-02 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=409867

Albert Astals Cid  changed:

   What|Removed |Added

 Status|REPORTED|RESOLVED
 Resolution|--- |FIXED
  Latest Commit||https://invent.kde.org/fram
   ||eworks/kwidgetsaddons/commi
   ||t/37c9ebe699e33f84700489982
   ||da301bdf8727bd3

--- Comment #5 from Albert Astals Cid  ---
Git commit 37c9ebe699e33f84700489982da301bdf8727bd3 by Albert Astals Cid, on
behalf of Glen Ditchfield.
Committed on 02/07/2020 at 20:46.
Pushed by aacid into branch 'master'.

Fix KTimeComboBox for locales with unusual characters in formats

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.
```
Related: bug 405857, bug 406240, bug 410167, bug 411820, bug 412506, bug 420468
```

M  +52   -3autotests/ktimecomboboxtest.cpp
M  +5-0autotests/ktimecomboboxtest.h
M  +26   -23   src/ktimecombobox.cpp

https://invent.kde.org/frameworks/kwidgetsaddons/commit/37c9ebe699e33f84700489982da301bdf8727bd3

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2020-06-29 Thread Filipus Klutiero
https://bugs.kde.org/show_bug.cgi?id=409867

--- Comment #4 from Filipus Klutiero  ---
Glen Ditchfield has proposed a very good-looking fix:
https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/3

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2019-07-21 Thread Filipus Klutiero
https://bugs.kde.org/show_bug.cgi?id=409867

Filipus Klutiero  changed:

   What|Removed |Added

   See Also||https://bugs.kde.org/show_b
   ||ug.cgi?id=409912

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2019-07-17 Thread Filipus Klutiero
https://bugs.kde.org/show_bug.cgi?id=409867

--- Comment #3 from Filipus Klutiero  ---
Ah, I forgot one point about the solution. I believe using the space character
both as blank and as a literal part of the mask is bad. But except for using a
different blank character (perhaps the underscore), I am not sure how that can
be fixed with QLineEdit as it currently stands.

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2019-07-16 Thread Filipus Klutiero
https://bugs.kde.org/show_bug.cgi?id=409867

--- Comment #2 from Filipus Klutiero  ---
This exceeds this ticket's scope, but there is another big problem with
timeFormatToInputMask(): in 12-hour systems (such as en_US, using format "11:59
PM"), it does not require the AM or PM characters, since the special characters
used in the mask are lowercase "a"-s. This allows users of such formats to
enter incomplete times such as "10:00", which will be quietly "saved" as
midnight.

The special character for a mandatory letter is an *uppercase* "A".

-- 
You are receiving this mail because:
You are watching all bug changes.

[frameworks-kwidgetsaddons] [Bug 409867] KTimeComboBox may not allow valid time entry, depending on format (timeFormatToInputMask() too fragile)

2019-07-16 Thread Filipus Klutiero
https://bugs.kde.org/show_bug.cgi?id=409867

--- Comment #1 from Filipus Klutiero  ---
Created attachment 121570
  --> https://bugs.kde.org/attachment.cgi?id=121570=edit
Screenshot of KOrganizer dialog with 2 affected fields

In this example, which shows a KOrganizer dialog in French Canadian, I
demonstrated the bug by entering invalid times with a digit (above) and a
letter (below) in a position supposed to contain a literal ("h").

-- 
You are receiving this mail because:
You are watching all bug changes.