diff --git mainwindow.cpp mainwindow.cpp index dbc8344..54d6718 100644 --- mainwindow.cpp +++ mainwindow.cpp @@ -76,6 +76,7 @@ void MainWindow::downloadFinished(QNetworkReply* aReply) { QString lResult = QString::fromUtf8(aReply->readAll()); debug(lResult); + XQueryReader xqr; // start city geocode if(aReply->url() == mStartCityUrl) @@ -83,8 +84,8 @@ void MainWindow::downloadFinished(QNetworkReply* aReply) mStartCityUrl.clear(); try { - ui->mStartLatitude->setText(mXQueryReader.extract(lResult, "GeocodeResponse/result/geometry/location/lat/text()").simplified()); - ui->mStartLongitude->setText(mXQueryReader.extract(lResult, "GeocodeResponse/result/geometry/location/lng/text()").simplified()); + ui->mStartLatitude->setText(xqr.extract(lResult, "GeocodeResponse/result/geometry/location/lat/text()").simplified()); + ui->mStartLongitude->setText(xqr.extract(lResult, "GeocodeResponse/result/geometry/location/lng/text()").simplified()); if(!ui->mStartLatitude->text().isEmpty() && !ui->mStartLongitude->text().isEmpty() && !ui->mEndLatitude->text().isEmpty() && !ui->mEndLongitude->text().isEmpty()) callForElevations(ui->mStartLatitude->text(), ui->mStartLongitude->text(), ui->mEndLatitude->text(), ui->mEndLongitude->text()); @@ -104,8 +105,8 @@ void MainWindow::downloadFinished(QNetworkReply* aReply) mEndCityUrl.clear(); try { - ui->mEndLatitude->setText(mXQueryReader.extract(lResult, "GeocodeResponse/result/geometry/location/lat/text()").simplified()); - ui->mEndLongitude->setText(mXQueryReader.extract(lResult, "GeocodeResponse/result/geometry/location/lng/text()").simplified()); + ui->mEndLatitude->setText(xqr.extract(lResult, "GeocodeResponse/result/geometry/location/lat/text()").simplified()); + ui->mEndLongitude->setText(xqr.extract(lResult, "GeocodeResponse/result/geometry/location/lng/text()").simplified()); if(!ui->mStartLatitude->text().isEmpty() && !ui->mStartLongitude->text().isEmpty() && !ui->mEndLatitude->text().isEmpty() && !ui->mEndLongitude->text().isEmpty()) callForElevations(ui->mStartLatitude->text(), ui->mStartLongitude->text(), ui->mEndLatitude->text(), ui->mEndLongitude->text()); diff --git mainwindow.h mainwindow.h index 4245e68..4e9605f 100644 --- mainwindow.h +++ mainwindow.h @@ -118,7 +118,7 @@ protected: void debug(QString aMessage); // geocode - XQueryReader mXQueryReader; + //XQueryReader mXQueryReader; // locations XmlElevationReader mXmlElevationReader;