D14435: Fix KTimeComboBox input mask for AM/PM times

2018-08-03 Thread Glenn Watson
glennw added a comment.


  Yes, you got the address and the reference correct - that sounds like it 
would have been quite the project!

REPOSITORY
  R236 KWidgetsAddons

REVISION DETAIL
  https://phabricator.kde.org/D14435

To: glennw, cfeck, mlaurent
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14435: Fix KTimeComboBox input mask for AM/PM times

2018-08-01 Thread Glenn Watson
glennw updated this revision to Diff 38890.
glennw added a comment.


  Switched test to use QVERIFY().

REPOSITORY
  R236 KWidgetsAddons

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14435?vs=38748=38890

REVISION DETAIL
  https://phabricator.kde.org/D14435

AFFECTED FILES
  autotests/ktimecomboboxtest.cpp
  autotests/ktimecomboboxtest.h
  src/ktimecombobox.cpp

To: glennw, cfeck, mlaurent
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14435: Fix KTimeComboBox input mask for AM/PM times

2018-07-30 Thread Glenn Watson
glennw updated this revision to Diff 38748.
glennw added a comment.


  Updated to include test for 24hr locales.

REPOSITORY
  R236 KWidgetsAddons

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14435?vs=38685=38748

REVISION DETAIL
  https://phabricator.kde.org/D14435

AFFECTED FILES
  autotests/ktimecomboboxtest.cpp
  autotests/ktimecomboboxtest.h
  src/ktimecombobox.cpp

To: glennw, cfeck, mlaurent
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14435: Fix KTimeComboBox input mask for AM/PM times

2018-07-28 Thread Glenn Watson
glennw updated this revision to Diff 38685.
glennw added a comment.


  Added an autotest to ensure that the line edit mask is updated correctly.
  
  A couple of notes about the test results below:
  
  - I tried to set the current locale in the new test to ensure it reproduces. 
The setLocale() function is not reentrant, which should be fine unless tests 
are run in parallel?
  - There are other tests in this file that fail before my patch, and now pass 
afterwards. I guess they are probably passing in CI due to the CI locale 
setting?
  
  Test results before this patch:
  
* Start testing of KTimeComboBoxTest *
Config: Using QtTest library 5.9.5, Qt 5.9.5 (x86_64-little_endian-lp64 
shared (dynamic) release build; by GCC 7.3.0)
PASS   : KTimeComboBoxTest::initTestCase()
PASS   : KTimeComboBoxTest::_q_showIfNotHidden()
FAIL!  : KTimeComboBoxTest::testDefaults() Compared values are not the same
   Actual   (m_combo->time())  : 12:00:00.000
   Expected (QTime(0, 0, 0, 0)): 00:00:00.000
   Loc: [kde/kwidgetsaddons/autotests/ktimecomboboxtest.cpp(33)]
PASS   : KTimeComboBoxTest::testValidNull()
FAIL!  : KTimeComboBoxTest::testTimeRange() Compared values are not the same
   Actual   (m_combo->isValid()): 1
   Expected (false) : 0
   Loc: [kde/kwidgetsaddons/autotests/ktimecomboboxtest.cpp(69)]
PASS   : KTimeComboBoxTest::testTimeListInterval()
PASS   : KTimeComboBoxTest::testTimeList()
PASS   : KTimeComboBoxTest::testOptions()
PASS   : KTimeComboBoxTest::testDisplayFormat()
FAIL!  : KTimeComboBoxTest::testMask() Compared values are not the same
   Actual   (mask.contains(QLatin1String("aa"))): 0
   Expected (true)  : 1
   Loc: [kde/kwidgetsaddons/autotests/ktimecomboboxtest.cpp(198)]
PASS   : KTimeComboBoxTest::cleanupTestCase()
Totals: 8 passed, 3 failed, 0 skipped, 0 blacklisted, 71ms
* Finished testing of KTimeComboBoxTest *
  
  Test results after:
  
* Start testing of KTimeComboBoxTest *
Config: Using QtTest library 5.9.5, Qt 5.9.5 (x86_64-little_endian-lp64 
shared (dynamic) release build; by GCC 7.3.0)
PASS   : KTimeComboBoxTest::initTestCase()
PASS   : KTimeComboBoxTest::_q_showIfNotHidden()
PASS   : KTimeComboBoxTest::testDefaults()
PASS   : KTimeComboBoxTest::testValidNull()
PASS   : KTimeComboBoxTest::testTimeRange()
PASS   : KTimeComboBoxTest::testTimeListInterval()
PASS   : KTimeComboBoxTest::testTimeList()
PASS   : KTimeComboBoxTest::testOptions()
PASS   : KTimeComboBoxTest::testDisplayFormat()
PASS   : KTimeComboBoxTest::testMask()
PASS   : KTimeComboBoxTest::cleanupTestCase()
Totals: 11 passed, 0 failed, 0 skipped, 0 blacklisted, 69ms
* Finished testing of KTimeComboBoxTest *

REPOSITORY
  R236 KWidgetsAddons

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D14435?vs=38638=38685

REVISION DETAIL
  https://phabricator.kde.org/D14435

AFFECTED FILES
  autotests/ktimecomboboxtest.cpp
  autotests/ktimecomboboxtest.h
  src/ktimecombobox.cpp

To: glennw, cfeck, mlaurent
Cc: ngraham, kde-frameworks-devel, michaelh, bruns


D14435: Fix KTimeComboBox input mask for AM/PM times

2018-07-28 Thread Glenn Watson
glennw added reviewers: cfeck, mlaurent.

REPOSITORY
  R236 KWidgetsAddons

REVISION DETAIL
  https://phabricator.kde.org/D14435

To: glennw, cfeck, mlaurent
Cc: kde-frameworks-devel, michaelh, ngraham, bruns


D14435: Fix KTimeComboBox input mask for AM/PM times

2018-07-28 Thread Glenn Watson
glennw created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: kde-frameworks-devel.
glennw requested review of this revision.

REVISION SUMMARY
  In some cases, the strings returned from amText() and
  pmText() may differ in case to the provided format
  in the timeFormatToInputMask method.
  
  This results in an incorrect mask string being provided
  to the line edit control.
  
  Instead, detect if the format string uses upper or lower
  case for the AM/PM specification, and use this to convert
  the am/pm text strings to a consistent case.
  
  BUG: 361764

REPOSITORY
  R236 KWidgetsAddons

REVISION DETAIL
  https://phabricator.kde.org/D14435

AFFECTED FILES
  src/ktimecombobox.cpp

To: glennw
Cc: kde-frameworks-devel, michaelh, ngraham, bruns