1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2019-11-26 08:15:01 +01:00
parent 3721084d21
commit b61c39ea46
2 changed files with 7 additions and 9 deletions

View File

@ -634,9 +634,10 @@ static void readPOIDatabase(QDataStream &stream, QTextCodec *codec,
} }
bool GPIParser::readData(QDataStream &stream, QTextCodec *codec, bool GPIParser::readData(QDataStream &stream, QTextCodec *codec,
QVector<Waypoint> &waypoints, QList<Area> &polygons, const QString &fileName, QVector<Waypoint> &waypoints, QList<Area> &polygons, const QString &fileName)
int &imgId)
{ {
int imgId = 0;
while (stream.status() == QDataStream::Ok) { while (stream.status() == QDataStream::Ok) {
switch (nextHeaderType(stream)) { switch (nextHeaderType(stream)) {
case 0x09: // POI database case 0x09: // POI database
@ -726,11 +727,9 @@ bool GPIParser::parse(QFile *file, QList<TrackData> &tracks,
{ {
Q_UNUSED(tracks); Q_UNUSED(tracks);
Q_UNUSED(routes); Q_UNUSED(routes);
Q_UNUSED(polygons);
QDataStream stream(file); QDataStream stream(file);
QTextCodec *codec = 0; QTextCodec *codec = 0;
quint32 ebs; quint32 ebs;
int imgId = 0;
stream.setByteOrder(QDataStream::LittleEndian); stream.setByteOrder(QDataStream::LittleEndian);
@ -741,9 +740,8 @@ bool GPIParser::parse(QFile *file, QList<TrackData> &tracks,
CryptDevice dev(stream.device(), 0xf870b5, ebs); CryptDevice dev(stream.device(), 0xf870b5, ebs);
QDataStream cryptStream(&dev); QDataStream cryptStream(&dev);
cryptStream.setByteOrder(QDataStream::LittleEndian); cryptStream.setByteOrder(QDataStream::LittleEndian);
return readData(cryptStream, codec, waypoints, polygons, file->fileName(), return readData(cryptStream, codec, waypoints, polygons,
imgId); file->fileName());
} else } else
return readData(stream, codec, waypoints, polygons, file->fileName(), return readData(stream, codec, waypoints, polygons, file->fileName());
imgId);
} }

View File

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