mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-02 05:49:15 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
cb09ea0681 | |||
e5d566807a | |||
0ce2cfd13c | |||
e1532b978f |
@ -1,4 +1,4 @@
|
||||
version: 5.8.{build}
|
||||
version: 5.9.{build}
|
||||
configuration: Release
|
||||
platform: Any CPU
|
||||
environment:
|
||||
|
@ -1,5 +1,5 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 5.8
|
||||
VERSION = 5.9
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
|
@ -84,7 +84,7 @@
|
||||
<message>
|
||||
<location filename="../src/data/data.cpp" line="117"/>
|
||||
<source>OziExplorer files</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>OziExplorer-filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/data/data.cpp" line="118"/>
|
||||
@ -1155,7 +1155,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="315"/>
|
||||
<source>Filtering</source>
|
||||
<translation>Filtrerar</translation>
|
||||
<translation>Filtrering</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/optionsdialog.cpp" line="316"/>
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.8"
|
||||
!define VERSION "5.9"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "5.8"
|
||||
!define VERSION "5.9"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -287,10 +287,9 @@ void MapView::setMap(Map *map)
|
||||
it.value()->setMap(_map);
|
||||
updatePOIVisibility();
|
||||
|
||||
QPointF oc = vr.center();
|
||||
QPointF nc = _map->ll2xy(cr.center());
|
||||
if (qAbs(oc.x() - nc.x()) >= 1.0 || qAbs(oc.y() - nc.y()) >= 1.0)
|
||||
centerOn(nc);
|
||||
QPointF nc = QRectF(_map->ll2xy(cr.topLeft()),
|
||||
_map->ll2xy(cr.bottomRight())).center();
|
||||
centerOn(nc);
|
||||
|
||||
resetCachedContent();
|
||||
QPixmapCache::clear();
|
||||
|
@ -91,9 +91,14 @@ bool Downloader::doDownload(const Download &dl,
|
||||
{
|
||||
QUrl url(dl.url());
|
||||
|
||||
if (!url.isValid() || !(url.scheme() == "http" || url.scheme() == "https")) {
|
||||
qWarning("%s: Invalid URL\n", qPrintable(url.toString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_errorDownloads.contains(url))
|
||||
return false;
|
||||
if (_currentDownloads.contains(url))
|
||||
if (_currentDownloads.contains(url) && !redirect)
|
||||
return false;
|
||||
|
||||
QNetworkRequest request(url);
|
||||
@ -107,10 +112,12 @@ bool Downloader::doDownload(const Download &dl,
|
||||
request.setRawHeader("Authorization", authorization);
|
||||
|
||||
QNetworkReply *reply = _manager.get(request);
|
||||
if (reply) {
|
||||
if (reply && reply->isRunning()) {
|
||||
_currentDownloads.insert(url);
|
||||
ReplyTimeout::setTimeout(reply, TIMEOUT);
|
||||
} else
|
||||
} else if (reply)
|
||||
downloadFinished(reply);
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -157,20 +164,25 @@ void Downloader::downloadFinished(QNetworkReply *reply)
|
||||
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl();
|
||||
int level = reply->request().attribute(ATTR_LEVEL).toInt();
|
||||
|
||||
if (location == url) {
|
||||
_errorDownloads.insert(url);
|
||||
qWarning("Error downloading file: %s: "
|
||||
"redirect loop\n", url.toEncoded().constData());
|
||||
} else if (level >= MAX_REDIRECT_LEVEL) {
|
||||
if (level >= MAX_REDIRECT_LEVEL) {
|
||||
_errorDownloads.insert(origin);
|
||||
qWarning("Error downloading file: %s: "
|
||||
"redirect level limit reached\n",
|
||||
"redirect level limit reached (redirect loop?)\n",
|
||||
origin.toEncoded().constData());
|
||||
} else {
|
||||
QUrl redirectUrl;
|
||||
if (location.isRelative()) {
|
||||
QString path = QDir::isAbsolutePath(location.path())
|
||||
? location.path() : "/" + location.path();
|
||||
redirectUrl = QUrl(url.scheme() + "://" + url.host() + path);
|
||||
} else
|
||||
redirectUrl = location;
|
||||
|
||||
Redirect redirect(origin.isEmpty() ? url : origin, level + 1);
|
||||
Download dl(location, filename);
|
||||
doDownload(dl, reply->request().rawHeader("Authorization"),
|
||||
&redirect);
|
||||
Download dl(redirectUrl, filename);
|
||||
if (!doDownload(dl, reply->request().rawHeader("Authorization"),
|
||||
&redirect))
|
||||
_errorDownloads.insert(origin.isEmpty() ? url : origin);
|
||||
}
|
||||
} else
|
||||
if (!saveToDisk(filename, reply))
|
||||
|
Reference in New Issue
Block a user