Diffstat (limited to 'noncore/settings/netsystemtime/settime.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/settime.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/noncore/settings/netsystemtime/settime.cpp b/noncore/settings/netsystemtime/settime.cpp index dac5bd4..01268c9 100644 --- a/noncore/settings/netsystemtime/settime.cpp +++ b/noncore/settings/netsystemtime/settime.cpp @@ -209,8 +209,4 @@ void SetDateTime::accept() void SetDateTime::commitTime() { - Config cfg("ntp",Config::User); - cfg.setGroup("lookups"); - int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); - cfg.writeEntry("time", time); tz->setFocus(); // really turn off the screensaver before doing anything @@ -228,7 +224,15 @@ void SetDateTime::commitTime() QDateTime dt( dateButton->date(), timeButton->time() ); - if ( dt.isValid() ) { + if ( dt.isValid() ) setTime(dt); +} + +void SetDateTime::setTime(QDateTime dt) +{ + Config cfg("ntp",Config::User); + cfg.setGroup("correction"); + int t = TimeConversion::toUTC(dt); struct timeval myTv; - myTv.tv_sec = TimeConversion::toUTC( dt ); + myTv.tv_sec = t; + cfg.writeEntry("time", t ); myTv.tv_usec = 0; @@ -240,7 +244,5 @@ void SetDateTime::commitTime() // (example re-trigger alarms for when we travel back in time) DateBookDB db; - } else { - qWarning( "Invalid date/time" ); - } + // set the timezone for everyone else... QCopEnvelope setTimeZone( "QPE/System", "timeChange(QString)" ); |