1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-30 15:52:12 +01:00

OP-1044 Uncrustify

This commit is contained in:
Alessio Morale 2013-07-19 14:23:41 +00:00
parent ab9f9cacec
commit 19a92ddc7e

View File

@ -33,8 +33,6 @@ const double UrlFactory::EarthRadiusKm = 6378.137; // WGS-84
UrlFactory::UrlFactory()
{
/// <summary>
/// timeout for map connections
/// </summary>
@ -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;