From 19a92ddc7e92f892857c6980dd8d9ffafdd9651d Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 19 Jul 2013 14:23:41 +0000 Subject: [PATCH] OP-1044 Uncrustify --- .../libs/opmapcontrol/src/core/urlfactory.cpp | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp index 39d2dc4c2..0bc943ff4 100644 --- a/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp +++ b/ground/openpilotgcs/src/libs/opmapcontrol/src/core/urlfactory.cpp @@ -33,8 +33,6 @@ const double UrlFactory::EarthRadiusKm = 6378.137; // WGS-84 UrlFactory::UrlFactory() { - - /// /// timeout for map connections /// @@ -89,16 +87,15 @@ bool UrlFactory::IsCorrectGoogleVersions() void UrlFactory::TryCorrectGoogleVersions() { static bool versionRetrieved = false; - if (versionRetrieved){ + + if (versionRetrieved) { return; } QMutexLocker locker(&mutex); if (CorrectGoogleVersions && !IsCorrectGoogleVersions()) { - - - QNetworkReply *reply; + QNetworkReply *reply; QNetworkRequest qheader; QNetworkAccessManager network; QEventLoop q; @@ -111,10 +108,10 @@ void UrlFactory::TryCorrectGoogleVersions() #ifdef DEBUG_URLFACTORY qDebug() << "Correct GoogleVersion"; #endif // DEBUG_URLFACTORY - //setIsCorrectGoogleVersions(true); + // setIsCorrectGoogleVersions(true); QString url = "https://maps.google.com"; - - qheader.setUrl(QUrl(url)); + + qheader.setUrl(QUrl(url)); qheader.setRawHeader("User-Agent", UserAgent); reply = network.get(qheader); tT.start(Timeout); @@ -135,7 +132,7 @@ void UrlFactory::TryCorrectGoogleVersions() QStringList gc = reg.capturedTexts(); VersionGoogleMap = QString("m@%1").arg(gc[1]); VersionGoogleMapChina = VersionGoogleMap; - VersionGoogleMapKorea = VersionGoogleMap; + VersionGoogleMapKorea = VersionGoogleMap; #ifdef DEBUG_URLFACTORY qDebug() << "TryCorrectGoogleVersions, VersionGoogleMap: " << VersionGoogleMap; #endif // DEBUG_URLFACTORY @@ -146,7 +143,7 @@ void UrlFactory::TryCorrectGoogleVersions() QStringList gc = reg.capturedTexts(); VersionGoogleLabels = QString("h@%1").arg(gc[1]); VersionGoogleLabelsChina = VersionGoogleLabels; - VersionGoogleLabelsKorea = VersionGoogleLabels; + VersionGoogleLabelsKorea = VersionGoogleLabels; #ifdef DEBUG_URLFACTORY qDebug() << "TryCorrectGoogleVersions, VersionGoogleLabels: " << VersionGoogleLabels; #endif // DEBUG_URLFACTORY @@ -154,7 +151,7 @@ void UrlFactory::TryCorrectGoogleVersions() reg = QRegExp("\"*https://khms0.google.com/kh/v=(\\d*)", Qt::CaseInsensitive); if (reg.indexIn(html) != -1) { QStringList gc = reg.capturedTexts(); - VersionGoogleSatellite = gc[1]; + VersionGoogleSatellite = gc[1]; VersionGoogleSatelliteKorea = VersionGoogleSatellite; VersionGoogleSatelliteChina = "s@" + VersionGoogleSatellite; @@ -200,8 +197,8 @@ QString UrlFactory::MakeImageUrl(const MapType::Types &type, const Point &pos, c QString sec2 = ""; // after &zoom=... GetSecGoogleWords(pos, sec1, sec2); TryCorrectGoogleVersions(); - QString VersionGoogleSatellite = "132"; - return QString("https://%1%2.google.com/%3/v=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatellite).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2); + QString VersionGoogleSatellite = "132"; + return QString("https://%1%2.google.com/%3/v=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleSatellite).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2); } break; case MapType::GoogleLabels: @@ -287,10 +284,10 @@ QString UrlFactory::MakeImageUrl(const MapType::Types &type, const Point &pos, c QString sec2 = ""; // after &zoom=... GetSecGoogleWords(pos, sec1, sec2); TryCorrectGoogleVersions(); - // https://mts0.google.com/vt/lyrs=m@224000000&hl=ko&gl=KR&src=app&x=107&y=50&z=7&s=Gal + // https://mts0.google.com/vt/lyrs=m@224000000&hl=ko&gl=KR&src=app&x=107&y=50&z=7&s=Gal // https://mts0.google.com/mt/v=kr1.11&hl=ko&x=109&y=49&z=7&s= - - qDebug() << QString("https://%1%2.google.com/%3/lyrs=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleMapKorea).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2); + + qDebug() << QString("https://%1%2.google.com/%3/lyrs=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleMapKorea).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2); QString ret = QString("https://%1%2.google.com/%3/lyrs=%4&hl=%5&x=%6%7&y=%8&z=%9&s=%10").arg(server).arg(GetServerNum(pos, 4)).arg(request).arg(VersionGoogleMapKorea).arg(language).arg(pos.X()).arg(sec1).arg(pos.Y()).arg(zoom).arg(sec2); return ret;