1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-18 12:54:23 +02:00

Compare commits

...

22 Commits
7.18 ... 7.19

Author SHA1 Message Date
d8b54ac342 Version++ 2020-01-12 16:09:06 +01:00
60b33064a7 Delete the popup immediately to prevent it "blocking" an error message 2020-01-12 16:01:38 +01:00
2efc6fb6d3 Optimization 2020-01-11 23:41:04 +01:00
8c9180190a Fixed buffer overflow 2020-01-05 00:50:02 +01:00
6839119794 Updated 4Umaps URL 2019-12-23 17:05:38 +01:00
05f23de1ed Clear the popup on scene clear
Fixes #257
2019-12-23 16:16:15 +01:00
9a0344adac Switched OpenStreetMap to HTTPS 2019-12-23 15:48:58 +01:00
fdeb24a196 Properly load non-ASCII map names 2019-12-20 23:39:20 +01:00
a986293f20 Properly handle points with extended style IDs 2019-12-09 22:50:19 +01:00
ec0b0adba0 Merge branch 'master' of https://github.com/tumic0/GPXSee 2019-12-04 22:20:01 +01:00
0f670f9ddd A much nicer (and faster) 24b conversion 2019-12-04 22:19:00 +01:00
ce59f13de7 Ukrainian localized comment for gpxsee.desktop entry (#259) 2019-12-03 08:19:14 +01:00
b59112f74e Added missing error handling 2019-12-01 13:33:00 +01:00
17b3602fda Fixed/improved pause detection
Fixes #250
2019-11-26 23:15:06 +01:00
c0928097cc Merge branch 'origin/master' into Weblate. 2019-11-26 20:17:22 +01:00
e709fad764 French description in desktop (#253) 2019-11-26 20:17:18 +01:00
fb566ae163 Merge branch 'origin/master' into Weblate. 2019-11-26 20:16:51 +01:00
3d8a4cc6b7 append Comment[tr] (#254) 2019-11-26 20:16:47 +01:00
4eb44a53f7 Merge branch 'origin/master' into Weblate. 2019-11-26 08:15:11 +01:00
b61c39ea46 Code cleanup 2019-11-26 08:15:01 +01:00
4767be1972 Translated using Weblate (French)
Currently translated at 100.0% (350 of 350 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fr/
2019-11-23 10:04:57 +01:00
ee9e17e31c Translated using Weblate (Ukrainian)
Currently translated at 100.0% (350 of 350 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/uk/
2019-11-20 13:24:45 +01:00
27 changed files with 62 additions and 45 deletions

View File

@ -1,4 +1,4 @@
version: 7.18.{build}
version: 7.19.{build}
configuration: Release
platform: Any CPU
environment:

View File

@ -3,7 +3,7 @@ unix:!macx {
} else {
TARGET = GPXSee
}
VERSION = 7.18
VERSION = 7.19
QT += core \
gui \

View File

@ -1147,12 +1147,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="67"/>
<source>Non-HiDPI maps are loaded as HiDPI maps. The map is sharp but map objects are small/hard to read.</source>
<translation>Les cartes qui n&apos;ont pas de résolution élevée sont chargées comme une carte à résolution élevée. La carte est nette mais ses symboles sont petits ou difficiles à lire.</translation>
<translation>Les cartes qui n&apos;ont pas de résolution élevée sont chargées comme une carte à résolution élevée. La carte est nette mais ses symboles sont petits et moins lisible.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="69"/>
<source>Non-HiDPI maps are loaded such as they are. Map objects have the expected size but the map is blurry.</source>
<translation>Les cartes qui n&apos;ont pas de résolution élevée sont chargées telles quelles. Les symboles de la carte ont leurs tailles attendues mais la carte est floue.</translation>
<translation>Les cartes qui n&apos;ont pas de résolution élevée sont chargées telles quelles. Les symboles de la carte ont une taille adaptée mais la carte est floue.</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="104"/>
@ -1276,7 +1276,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="352"/>
<source>Automatic</source>
<translation type="unfinished"></translation>
<translation>Automatique</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="366"/>
@ -1399,7 +1399,7 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="353"/>
<source>Custom</source>
<translation type="unfinished"></translation>
<translation>Personnalisé</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="477"/>
@ -1884,7 +1884,7 @@
<message>
<location filename="../src/GUI/waypointitem.cpp" line="44"/>
<source>Address</source>
<translation type="unfinished"></translation>
<translation>Adresse</translation>
</message>
<message>
<location filename="../src/GUI/waypointitem.cpp" line="55"/>

View File

@ -1312,12 +1312,12 @@
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="352"/>
<source>Automatic</source>
<translation type="unfinished"></translation>
<translation>Автоматичне</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="353"/>
<source>Custom</source>
<translation type="unfinished"></translation>
<translation>Користувацьке</translation>
</message>
<message>
<location filename="../src/GUI/optionsdialog.cpp" line="366"/>

View File

@ -3,9 +3,12 @@ Name=GPXSee
Comment=GPS log file viewer and analyzer
Comment[cz]=Prohlížeč a analyzátor GPS logů
Comment[fi]=Ohjelma GPS-lokien katseluun ja analysointiin
Comment[fr]=Visualisation et analyse de fichier GPS
Comment[pl]=Przeglądarka i analizator plików dziennika GPS
Comment[ru]=Программа для просмотра и анализа GPS логов
Comment[sv]=GPS-loggfilsläsare och analysator
Comment[tr]=GPS günlük dosyası görüntüleyici ve analizcisi
Comment[uk]=Переглядач та аналізатор GPS логів
Exec=gpxsee %F
Icon=gpxsee
Terminal=false

View File

@ -7,7 +7,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "7.18"
!define VERSION "7.19"
; The file to write
OutFile "GPXSee-${VERSION}.exe"

View File

@ -7,7 +7,7 @@
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "7.18"
!define VERSION "7.19"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.gpxsee.org/map/1.3">
<name>4UMaps</name>
<url>https://4umaps.com/$z/$x/$y.png</url>
<url>https://tileserver.4umaps.com/$z/$x/$y.png</url>
<zoom min="2" max="15"/>
<bounds bottom="-65"/>
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © 4UMaps.eu</copyright>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://www.gpxsee.org/map/1.3">
<name>Open Street Map</name>
<url>http://tile.openstreetmap.org/$z/$x/$y.png</url>
<url>https://tile.openstreetmap.org/$z/$x/$y.png</url>
<copyright>Map data: © OpenStreetMap contributors (ODbL) | Rendering: © OpenStreetMap (CC-BY-SA)</copyright>
</map>

View File

@ -46,3 +46,9 @@ void GraphicsScene::helpEvent(QGraphicsSceneHelpEvent *event)
/* No need to process QGraphicsScene::helpEvent() */
}
void GraphicsScene::clear()
{
Popup::clear();
QGraphicsScene::clear();
}

View File

@ -18,6 +18,9 @@ class GraphicsScene : public QGraphicsScene
public:
GraphicsScene(QObject *parent = 0) : QGraphicsScene(parent) {}
public slots:
void clear();
protected:
void helpEvent(QGraphicsSceneHelpEvent *event);

View File

@ -163,3 +163,9 @@ void Popup::show(const QPoint &pos, const QString &text, QWidget *w)
PopupLabel::_instance->place(pos, w);
PopupLabel::_instance->showNormal();
}
void Popup::clear()
{
if (PopupLabel::_instance)
delete PopupLabel::_instance;
}

View File

@ -9,6 +9,7 @@ class Popup
{
public:
static void show(const QPoint &pos, const QString &text, QWidget *w);
static void clear();
};
#endif // POPUP_H

View File

@ -10,9 +10,7 @@ inline double toWGS32(qint32 v)
inline double toWGS24(qint32 v)
{
return (v < 0x800000)
? (double)v * 360.0 / (double)(1U<<24)
: (double)(v - 0x1000000) * 360.0 / (double)(1<<24);
return toWGS32(v<<8);
}
#endif // GARMIN_H

View File

@ -1,3 +1,4 @@
#include <cstring>
#include <QDataStream>
#include <QTextCodec>
#include <QtEndian>
@ -169,15 +170,16 @@ static quint32 readTranslatedObjects(QDataStream &stream, QTextCodec *codec,
QList<TranslatedString> &objects)
{
qint32 size = 0, ret;
char lang[2];
char lang[3];
memset(lang, 0, sizeof(lang));
objects.clear();
stream >> size;
ret = size + 4;
while (stream.status() == QDataStream::Ok && size > 0) {
QString str;
stream.readRawData(lang, sizeof(lang));
stream.readRawData(lang, sizeof(lang) - 1);
size -= readString(stream, codec, str) + 2;
objects.append(TranslatedString(lang, str));
}
@ -634,9 +636,10 @@ static void readPOIDatabase(QDataStream &stream, QTextCodec *codec,
}
bool GPIParser::readData(QDataStream &stream, QTextCodec *codec,
QVector<Waypoint> &waypoints, QList<Area> &polygons, const QString &fileName,
int &imgId)
QVector<Waypoint> &waypoints, QList<Area> &polygons, const QString &fileName)
{
int imgId = 0;
while (stream.status() == QDataStream::Ok) {
switch (nextHeaderType(stream)) {
case 0x09: // POI database
@ -726,11 +729,9 @@ bool GPIParser::parse(QFile *file, QList<TrackData> &tracks,
{
Q_UNUSED(tracks);
Q_UNUSED(routes);
Q_UNUSED(polygons);
QDataStream stream(file);
QTextCodec *codec = 0;
quint32 ebs;
int imgId = 0;
stream.setByteOrder(QDataStream::LittleEndian);
@ -741,9 +742,8 @@ bool GPIParser::parse(QFile *file, QList<TrackData> &tracks,
CryptDevice dev(stream.device(), 0xf870b5, ebs);
QDataStream cryptStream(&dev);
cryptStream.setByteOrder(QDataStream::LittleEndian);
return readData(cryptStream, codec, waypoints, polygons, file->fileName(),
imgId);
return readData(cryptStream, codec, waypoints, polygons,
file->fileName());
} else
return readData(stream, codec, waypoints, polygons, file->fileName(),
imgId);
return readData(stream, codec, waypoints, polygons, file->fileName());
}

View File

@ -19,7 +19,7 @@ private:
bool readGPIHeader(QDataStream &stream, QTextCodec **codec);
bool readData(QDataStream &stream, QTextCodec *codec,
QVector<Waypoint> &waypoints, QList<Area> &polygons,
const QString &fileName, int &imgId);
const QString &fileName);
QString _errorString;
};

View File

@ -151,7 +151,7 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
qreal pauseSpeed;
if (_automaticPause) {
pauseSpeed = (avg(seg.speed) > 2.8) ? 0.55 : 0.15;
pauseSpeed = (avg(seg.speed) > 2.8) ? 0.40 : 0.15;
pauseInterval = 10;
} else {
pauseSpeed = _pauseSpeed;
@ -163,7 +163,7 @@ Track::Track(const TrackData &data) : _data(data), _pause(0)
if (seg.speed.at(j) > pauseSpeed)
ss = -1;
else if (ss < 0)
ss = j;
ss = j-1;
if (ss >= 0 && seg.time.at(j) > seg.time.at(ss) + pauseInterval) {
int l = qMax(ss, la);

View File

@ -50,8 +50,9 @@ IMG::IMG(const QString &fileName)
CHECK(_file.seek(0x49) && read(d1, sizeof(d1)) && _file.seek(0x61)
&& readValue(e1) && readValue(e2) && _file.seek(0x65)
&& read(d2, sizeof(d2)));
QByteArray nba(QByteArray(d1, sizeof(d1)) + QByteArray(d2, sizeof(d2)));
_name = QString(nba).trimmed();
_name = QString::fromLatin1(nba.constData(), nba.size()-1).trimmed();
_blockSize = 1 << (e1 + e2);
_blockCache.setMaxCost(CACHE_SIZE / _blockSize);

View File

@ -50,9 +50,8 @@ static QString capitalize(const QString &str)
}
bool LBLFile::init()
bool LBLFile::init(Handle &hdl)
{
Handle hdl;
quint16 codepage;
quint8 multiplier, poiMultiplier;
@ -165,7 +164,7 @@ Label LBLFile::label8b(Handle &hdl, quint32 offset) const
Label LBLFile::label(Handle &hdl, quint32 offset, bool poi)
{
if (!_multiplier && !init())
if (!_multiplier && !init(hdl))
return QString();
quint32 labelOffset;

View File

@ -19,7 +19,7 @@ public:
Label label(Handle &hdl, quint32 offset, bool poi = false);
private:
bool init();
bool init(Handle &hdl);
Label label6b(Handle &hdl, quint32 offset) const;
Label label8b(Handle &hdl, quint32 offset) const;

View File

@ -1,8 +1,7 @@
#include "netfile.h"
bool NETFile::init()
bool NETFile::init(Handle &hdl)
{
Handle hdl;
quint8 multiplier;
if (!(seek(hdl, _gmpOffset + 0x15) && readUInt32(hdl, _offset)
@ -16,7 +15,7 @@ bool NETFile::init()
bool NETFile::lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset)
{
if (!_multiplier && !init())
if (!_multiplier && !init(hdl))
return false;
if (!(seek(hdl, _offset + netOffset * _multiplier)

View File

@ -13,7 +13,7 @@ public:
bool lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset);
private:
bool init();
bool init(Handle &hdl);
quint32 _offset;
quint32 _size;

View File

@ -119,9 +119,8 @@ bool RGNFile::DeltaStream::sign(int &val)
}
bool RGNFile::init()
bool RGNFile::init(Handle &hdl)
{
Handle hdl;
quint16 hdrLen;
if (!(seek(hdl, _gmpOffset) && readUInt16(hdl, hdrLen)
@ -395,7 +394,7 @@ void RGNFile::objects(const RectC &rect, const SubDiv *subdiv, LBLFile *lbl,
{
Handle rgnHdl, lblHdl, netHdl;
if (!_init && !init())
if (!_init && !init(rgnHdl))
return;
QVector<RGNFile::Segment> seg(segments(rgnHdl, subdiv));
@ -427,7 +426,7 @@ void RGNFile::extObjects(const RectC &rect, const SubDiv *subdiv, LBLFile *lbl,
{
Handle rgnHdl, lblHdl;
if (!_init && !init())
if (!_init && !init(rgnHdl))
return;
if (polygons && subdiv->polygonsOffset() != subdiv->polygonsEnd()) {

View File

@ -93,7 +93,7 @@ private:
quint32 _lonBits, _latBits, _readBits;
};
bool init();
bool init(Handle &hdl);
QVector<Segment> segments(Handle &hdl, const SubDiv *subdiv) const;
bool polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv,

View File

@ -966,7 +966,7 @@ const Style::Point &Style::point(quint32 type) const
{
static Point null;
QMap<quint16, Point>::const_iterator it = _points.find(type);
QMap<quint32, Point>::const_iterator it = _points.find(type);
return (it == _points.constEnd()) ? null : *it;
}

View File

@ -142,7 +142,7 @@ private:
QMap<quint32, Line> _lines;
QMap<quint32, Polygon> _polygons;
QMap<quint16, Point> _points;
QMap<quint32, Point> _points;
QList<quint32> _drawOrder;
};

View File

@ -100,6 +100,8 @@ static QPainterPath textPath(const QPolygonF &path, qreal textWidth,
qreal charWidth, const QRectF &tileRect)
{
QList<QLineF> lines(lineString(path, tileRect));
if (lines.isEmpty())
return QPainterPath();
qreal length = 0;
qreal angle = lines.first().angle();
int last = 0;