-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp index 111f7d4..6e74e32 100644 --- a/noncore/settings/netsystemtime/ntp.cpp +++ b/noncore/settings/netsystemtime/ntp.cpp @@ -155,54 +155,55 @@ void Ntp::slotRunNtp() qDebug("Error while executing ntpdate"); ntpOutPut( tr("Error while executing ntpdate")); } } void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) { if (! proc ) qDebug("Ntp::getNtpOutput OProcess is null"); QString lineStr, lineStrOld; lineStr = buffer; lineStr=lineStr.left(buflen); if (lineStr!=lineStrOld) { ntpOutPut(lineStr); _ntpOutput += lineStr; } lineStrOld = lineStr; } void Ntp::ntpFinished(OProcess *p) { qDebug("p->exitStatus() %i",p->exitStatus()); if (p->exitStatus()!=0 || !p->normalExit()) { - QMessageBox::critical(this, tr("ntp error"), + if ( isVisible() ) { + QMessageBox::critical(this, tr("ntp error"), tr("Error while getting time form\n server")+ getNtpServer()+"\n"+ _ntpOutput ); - // TabWidgetMain->setCurrentPage( 1 ); - TabWidgetMain->showPage( tabManualSetTime ); + TabWidgetMain->showPage( tabManualSetTime ); + } return; } Global::writeHWClock(); // since time has changed quickly load in the datebookdb // to allow the alarm server to get a better grip on itself // (example re-trigger alarms for when we travel back in time) DateBookDB db; // QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" ); // timeApplet << ""; Config cfg("ntp",Config::User); cfg.setGroup("lookups"); int lastLookup = cfg.readNumEntry("time",0); int lookupCount = cfg.readNumEntry("count",0); bool lastNtp = cfg.readBoolEntry("lastNtp",false); int time = TimeConversion::toUTC( QDateTime::currentDateTime() ); cfg.writeEntry("time", time); float timeShift = getTimeShift(); if (timeShift == 0.0) return; int secsSinceLast = time - lastLookup; |