Seeing the "TODO" in KTimeComboBoxPrivate::timeFormatToInputMask, I decided to try and replace the input mask with a QValidator approach (as seen in KDatePicker).
This is a first iteration to see if there is interest and if the approach I took is acceptable.
Thanks for any comments.
Details
- Reviewers
cfeck
As of now, compiled and only ran test suite. 10/10 pass.
Diff Detail
- Repository
- R236 KWidgetsAddons
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Several code style issues. Please run it through uncrustify-kf5.cfg (see kde-dev-scripts.git)
Ran through uncrustify.
Found a regression in my patch : colon (":") wouldn't be shown anymore, as it is dependent on the input mask. So I left the input mask, and the QValidator works in addition to the input mask.
Are you sure the patch is complete? I remember there was code which was supposed to be replaced by the new validator.
src/ktimecombobox.cpp | ||
---|---|---|
608 | This does not look right. |
src/ktimecombobox.cpp | ||
---|---|---|
33 | Please use "const &" for all QTime and QString arguments. | |
34 | Since "min" and "max" might be macros for some compilers, please rename to "minTime" and "maxTime". | |
37 | setMinTime(const QTime &minTime); It looks more verbose, but also more correct :) | |
42 | Also here, m_minTime and m_maxTime. | |
76 | const QTime time = ... | |
231 | So the KTimeComboBox class already has m_min/maxTime members. Can the code be refactored that they do not need to be stored twice? |
src/ktimecombobox.cpp | ||
---|---|---|
33 | Here and below: nullptr can be used directly in KF5 |