author | tille <tille> | 2002-06-25 13:39:50 (UTC) |
---|---|---|
committer | tille <tille> | 2002-06-25 13:39:50 (UTC) |
commit | a3f1ec6a75ea762a54ed218f205956ca28d61599 (patch) (side-by-side diff) | |
tree | 60d6911a808803dcfed90e7887a901c52b3443b0 /noncore/settings/netsystemtime/settime.cpp | |
parent | 8501705e4e50602aaabe9877e6d8821555e3a05a (diff) | |
download | opie-a3f1ec6a75ea762a54ed218f205956ca28d61599.zip opie-a3f1ec6a75ea762a54ed218f205956ca28d61599.tar.gz opie-a3f1ec6a75ea762a54ed218f205956ca28d61599.tar.bz2 |
doing something ;)
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)" ); |