DevHeads.net

Review Request 113152: kcm_clock: Check for valid return values of QDateTime::toTime_t()

Review request for kde-workspace.

Repository: kde-workspace

Description
Using the date selector in kcm_clock to set any date further than February 7, 2106 resulted in setting the time to ((time_t) (unsigned int) -1). This patch makes setting any date further than this to spit out an DateError.
Also, it's a seed for discussion regarding this KCM module as passing the values as QStrings and converting from/to time_t doesn't seem like a manageable solution to the problem.
Thanks for your opinions.

Diffs
kcontrol/dateandtime/dtime.cpp 518afe5
kcontrol/dateandtime/helper.cpp 9168db3

Diff: <a href="http://git.reviewboard.kde.org/r/113152/diff/" title="http://git.reviewboard.kde.org/r/113152/diff/">http://git.reviewboard.kde.org/r/113152/diff/</a>

Testing
Built and tested on Fedora 19 x86_64.

Thanks,

Martin Bříza

Comments

Re: Review Request 113152: kcm_clock: Check for valid return val

By =?utf-8?b?TWFyd... at 02/25/2017 - 20:37

(Updated Feb. 26, 2017, 12:37 a.m.)

Status
This change has been discarded.

Review request for kde-workspace.

Repository: kde-workspace

Description
Using the date selector in kcm_clock to set any date further than February 7, 2106 resulted in setting the time to ((time_t) (unsigned int) -1). This patch makes setting any date further than this to spit out an DateError.
Also, it's a seed for discussion regarding this KCM module as passing the values as QStrings and converting from/to time_t doesn't seem like a manageable solution to the problem.
Thanks for your opinions.

Diffs
kcontrol/dateandtime/dtime.cpp 518afe5
kcontrol/dateandtime/helper.cpp 9168db3

Diff: <a href="https://git.reviewboard.kde.org/r/113152/diff/" title="https://git.reviewboard.kde.org/r/113152/diff/">https://git.reviewboard.kde.org/r/113152/diff/</a>

Testing
Built and tested on Fedora 19 x86_64.

Thanks,

Martin Bříza

Re: Review Request 113152: kcm_clock: Check for valid return val

By Albert Astals Cid at 02/25/2017 - 20:37

Patch wasn't commited for years so i guess it wasn't that important.

Discarding.

- Albert Astals Cid

On Oct. 7, 2013, 4:06 p.m., Martin Bříza wrote:

Re: Review Request 113152: kcm_clock: Check for valid return val

By =?utf-8?b?THVrw... at 06/13/2014 - 09:34

Ship it!

OK, let's ship it :) Fix was reviewed for RHEL 7

- Lukáš Tinkl

On Oct. 7, 2013, 6:06 p.m., Martin Bříza wrote:

Re: Review Request 113152: kcm_clock: Check for valid return val

By =?utf-8?b?THVrw... at 11/27/2013 - 14:04

What's the status here? Has this been submitted?

- Lukáš Tinkl

On Oct. 7, 2013, 6:06 p.m., Martin Bříza wrote: