author | erik <erik> | 2007-04-23 20:38:22 (UTC) |
---|---|---|
committer | erik <erik> | 2007-04-23 20:38:22 (UTC) |
commit | d38e40fe9ee475230425fa83e924c49e5946b87c (patch) (side-by-side diff) | |
tree | f10fceda92538e1bc9cee66f82062773974ec092 /noncore/settings/netsystemtime/timetabwidget.cpp | |
parent | 1edbb754d3c8cfccf1630e2ad1e531e907555cbd (diff) | |
download | opie-d38e40fe9ee475230425fa83e924c49e5946b87c.zip opie-d38e40fe9ee475230425fa83e924c49e5946b87c.tar.gz opie-d38e40fe9ee475230425fa83e924c49e5946b87c.tar.bz2 |
Fix for bug 1848 where the outcome of setting the time to 12:00AM did not
work.
This commit is based on a patch submitted by harlekin. Thank you!
Diffstat (limited to 'noncore/settings/netsystemtime/timetabwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/timetabwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/timetabwidget.cpp b/noncore/settings/netsystemtime/timetabwidget.cpp index 895514b..e6fcf7f 100644 --- a/noncore/settings/netsystemtime/timetabwidget.cpp +++ b/noncore/settings/netsystemtime/timetabwidget.cpp @@ -164,33 +164,33 @@ void TimeTabWidget::saveSettings( bool commit ) setSystemTime( dt ); } else { // Reset systemtime to hardware clock (i.e. undo any changes made by this app) system("/sbin/hwclock --hctosys --utc"); } } void TimeTabWidget::setDateTime( const QDateTime &dt ) { // Set time QTime t = dt.time(); if( use12HourTime ) { int show_hour = t.hour(); - if ( t.hour() >= 12 ) + if ( t.hour() > 12 ) { show_hour -= 12; cbAmpm->setCurrentItem( ValuePM ); } else { cbAmpm->setCurrentItem( ValueAM ); } if ( show_hour == 0 ) show_hour = 12; sbHour->setValue( show_hour ); } else { sbHour->setValue( t.hour() ); } @@ -226,33 +226,33 @@ void TimeTabWidget::setSystemTime( const QDateTime &dt ) } } void TimeTabWidget::slotUse12HourTime( int i ) { use12HourTime = (i == 1); cbAmpm->setEnabled( use12HourTime ); int show_hour = sbHour->value(); if ( use12HourTime ) { sbHour->setMinValue( 1 ); sbHour->setMaxValue( 12 ); - if ( show_hour >= 12 ) + if ( show_hour > 12 ) { show_hour -= 12; cbAmpm->setCurrentItem( ValuePM ); } else { cbAmpm->setCurrentItem( ValueAM ); } if ( show_hour == 0 ) show_hour = 12; } else { sbHour->setMinValue( 0 ); sbHour->setMaxValue( 23 ); |