summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 6c5aaf5..9572993 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -134,50 +134,50 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
134 lineStr=lineStr.left(buflen); 134 lineStr=lineStr.left(buflen);
135 if (lineStr!=lineStrOld) 135 if (lineStr!=lineStrOld)
136 { 136 {
137 ntpOutPut(lineStr); 137 ntpOutPut(lineStr);
138 _ntpOutput += lineStr; 138 _ntpOutput += lineStr;
139 } 139 }
140 lineStrOld = lineStr; 140 lineStrOld = lineStr;
141} 141}
142 142
143void Ntp::ntpFinished(OProcess *p) 143void Ntp::ntpFinished(OProcess *p)
144{ 144{
145 qDebug("p->exitStatus() %i",p->exitStatus()); 145 qDebug("p->exitStatus() %i",p->exitStatus());
146 if (p->exitStatus()!=0 || !p->normalExit()) 146 if (p->exitStatus()!=0 || !p->normalExit())
147 { 147 {
148 slotProbeNtpServer(); 148 slotProbeNtpServer();
149 return; 149 return;
150 } 150 }
151 151
152 Global::writeHWClock(); 152 Global::writeHWClock();
153 // since time has changed quickly load in the datebookdb 153 // since time has changed quickly load in the datebookdb
154 // to allow the alarm server to get a better grip on itself 154 // to allow the alarm server to get a better grip on itself
155 // (example re-trigger alarms for when we travel back in time) 155 // (example re-trigger alarms for when we travel back in time)
156 DateBookDB db; 156 DateBookDB db;
157 157
158 QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" ); 158// QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" );
159 timeApplet << ""; 159// timeApplet << "";
160 160
161 Config cfg("ntp",Config::User); 161 Config cfg("ntp",Config::User);
162 cfg.setGroup("lookups"); 162 cfg.setGroup("lookups");
163 int lastLookup = cfg.readNumEntry("time",0); 163 int lastLookup = cfg.readNumEntry("time",0);
164 int lookupCount = cfg.readNumEntry("count",0); 164 int lookupCount = cfg.readNumEntry("count",0);
165 bool lastNtp = cfg.readBoolEntry("lastNtp",false); 165 bool lastNtp = cfg.readBoolEntry("lastNtp",false);
166 int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); 166 int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
167 cfg.writeEntry("time", time); 167 cfg.writeEntry("time", time);
168 168
169 float timeShift = getTimeShift(); 169 float timeShift = getTimeShift();
170 if (timeShift == 0.0) return; 170 if (timeShift == 0.0) return;
171 int secsSinceLast = time - lastLookup; 171 int secsSinceLast = time - lastLookup;
172 TextLabelNewTime->setText(QDateTime::currentDateTime().toString()); 172 TextLabelNewTime->setText(QDateTime::currentDateTime().toString());
173 TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds")); 173 TextLabelTimeShift->setText(QString::number(timeShift)+tr(" seconds"));
174 if ( lastNtp && lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value()) 174 if ( lastNtp && lastLookup > 0 && secsSinceLast > 60* SpinBoxMinLookupDelay->value())
175 { 175 {
176 cfg.setGroup("lookup_"+QString::number(lookupCount)); 176 cfg.setGroup("lookup_"+QString::number(lookupCount));
177 lookupCount++; 177 lookupCount++;
178 _shiftPerSec = timeShift / secsSinceLast; 178 _shiftPerSec = timeShift / secsSinceLast;
179 qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec); 179 qDebug("secs since last lookup %i", secsSinceLast);qDebug("timeshift since last lookup %f", timeShift);qDebug("timeshift since per sec %f", _shiftPerSec);
180 cfg.writeEntry("secsSinceLast",secsSinceLast); 180 cfg.writeEntry("secsSinceLast",secsSinceLast);
181 cfg.writeEntry("timeShift",QString::number(timeShift)); 181 cfg.writeEntry("timeShift",QString::number(timeShift));
182 cfg.setGroup("lookups"); 182 cfg.setGroup("lookups");
183 cfg.writeEntry("count",lookupCount); 183 cfg.writeEntry("count",lookupCount);
@@ -308,25 +308,25 @@ void Ntp::makeChannel()
308 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 308 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
309 this, SLOT(receive(const QCString&, const QByteArray&)) ); 309 this, SLOT(receive(const QCString&, const QByteArray&)) );
310} 310}
311 311
312 312
313 313
314void Ntp::receive(const QCString &msg, const QByteArray &arg) 314void Ntp::receive(const QCString &msg, const QByteArray &arg)
315{ 315{
316 qDebug("QCop(Ntp) "+msg+" "+QCString(arg)); 316 qDebug("QCop(Ntp) "+msg+" "+QCString(arg));
317 if ( msg == "ntpLookup(QString)" ) 317 if ( msg == "ntpLookup(QString)" )
318 { 318 {
319 slotRunNtp(); 319 slotRunNtp();
320 } 320 }
321 if ( msg == "setPredictedTime(QString)" ) 321 if ( msg == "setPredictedTime(QString)" )
322 { 322 {
323 setPredictTime(); 323 setPredictTime();
324 }else{ 324 }else{
325 qDebug("Ntp::receive: Huh what do ya want"); 325 qDebug("Ntp::receive: Huh what do ya want");
326 } 326 }
327} 327}
328 328
329void Ntp::setDocument(const QString &fileName) 329void Ntp::setDocument(const QString &fileName)
330{ 330{
331 331
332} \ No newline at end of file 332}