Changeset View
Changeset View
Standalone View
Standalone View
runners/calculator/qalculate_engine.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | void QalculateEngine::updateExchangeRates() | 63 | void QalculateEngine::updateExchangeRates() | ||
64 | { | 64 | { | ||
65 | QUrl source = QUrl("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"); | 65 | QUrl source = QUrl("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"); | ||
66 | QUrl dest = QUrl::fromLocalFile(QFile::decodeName(CALCULATOR->getExchangeRatesFileName().c_str())); | 66 | QUrl dest = QUrl::fromLocalFile(QFile::decodeName(CALCULATOR->getExchangeRatesFileName().c_str())); | ||
67 | 67 | | |||
68 | KIO::Job* getJob = KIO::file_copy(source, dest, -1, KIO::Overwrite | KIO::HideProgressInfo); | 68 | KIO::Job* getJob = KIO::file_copy(source, dest, -1, KIO::Overwrite | KIO::HideProgressInfo); | ||
69 | connect( getJob, SIGNAL(result(KJob*)), this, SLOT(updateResult(KJob*)) ); | 69 | connect( getJob, &KJob::result, this, &QalculateEngine::updateResult ); | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | void QalculateEngine::updateResult(KJob* job) | 72 | void QalculateEngine::updateResult(KJob* job) | ||
73 | { | 73 | { | ||
74 | if (job->error()) { | 74 | if (job->error()) { | ||
75 | qDebug() << i18n("The exchange rates could not be updated. The following error has been reported: %1",job->errorString()); | 75 | qDebug() << i18n("The exchange rates could not be updated. The following error has been reported: %1",job->errorString()); | ||
76 | } else { | 76 | } else { | ||
77 | // the exchange rates have been successfully updated, now load them | 77 | // the exchange rates have been successfully updated, now load them | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |