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

Compare commits

..

No commits in common. "037d621f5006ed9e703c22a1950a59655af4e862" and "36f8f94f157cd423af137070fe95f06ca90963be" have entirely different histories.

75 changed files with 3704 additions and 4003 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,8 @@
#include "areaitem.h" #include "areaitem.h"
ToolTip AreaItem::info(bool extended) const ToolTip AreaItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
if (!_area.name().isEmpty()) if (!_area.name().isEmpty())

View File

@ -26,7 +26,7 @@ public:
void setDigitalZoom(int zoom); void setDigitalZoom(int zoom);
void updateStyle(); void updateStyle();
ToolTip info(bool extended) const; ToolTip info() const;
protected: protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverEnterEvent(QGraphicsSceneHoverEvent *event);

View File

@ -9,9 +9,8 @@ CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
{ {
} }
ToolTip CadenceGraphItem::info(bool extended) const ToolTip CadenceGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
QLocale l(QLocale::system()); QLocale l(QLocale::system());

View File

@ -11,7 +11,7 @@ public:
CadenceGraphItem(const Graph &graph, GraphType type, int width, CadenceGraphItem(const Graph &graph, GraphType type, int width,
const QColor &color, QGraphicsItem *parent = 0); const QColor &color, QGraphicsItem *parent = 0);
ToolTip info(bool extended) const; ToolTip info() const;
}; };
#endif // CADENCEGRAPHITEM_H #endif // CADENCEGRAPHITEM_H

View File

@ -26,10 +26,8 @@ ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
} }
} }
ToolTip ElevationGraphItem::info(bool extended) const ToolTip ElevationGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
qreal scale = (_units == Metric) ? 1.0 : M2FT; qreal scale = (_units == Metric) ? 1.0 : M2FT;
QString su = (_units == Metric) ? tr("m") : tr("ft"); QString su = (_units == Metric) ? tr("m") : tr("ft");

View File

@ -18,7 +18,7 @@ public:
qreal max() const {return _max;} qreal max() const {return _max;}
qreal min() const {return _min;} qreal min() const {return _min;}
ToolTip info(bool extended) const; ToolTip info() const;
private: private:
qreal _ascent, _descent, _min, _max; qreal _ascent, _descent, _min, _max;

View File

@ -27,10 +27,8 @@ GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
_top = key; _top = key;
} }
ToolTip GearRatioGraphItem::info(bool extended) const ToolTip GearRatioGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
QLocale l(QLocale::system()); QLocale l(QLocale::system());

View File

@ -15,7 +15,7 @@ public:
qreal top() const {return _top;} qreal top() const {return _top;}
const QMap<qreal, qreal> &map() const {return _map;} const QMap<qreal, qreal> &map() const {return _map;}
ToolTip info(bool extended) const; ToolTip info() const;
private: private:
QMap<qreal, qreal> _map; QMap<qreal, qreal> _map;

View File

@ -41,8 +41,7 @@ void GraphicsScene::helpEvent(QGraphicsSceneHelpEvent *event)
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
if (list.at(i)->type() == QGraphicsItem::UserType + 1) { if (list.at(i)->type() == QGraphicsItem::UserType + 1) {
GraphicsItem *mi = static_cast<GraphicsItem*>(list.at(i)); GraphicsItem *mi = static_cast<GraphicsItem*>(list.at(i));
Popup::show(event->screenPos(), mi->info(_showExtendedInfo), Popup::show(event->screenPos(), mi->info(), event->widget());
event->widget());
return; return;
} }
} }

View File

@ -10,7 +10,7 @@ class GraphicsItem : public QGraphicsItem
public: public:
GraphicsItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent) {} GraphicsItem(QGraphicsItem *parent = 0) : QGraphicsItem(parent) {}
virtual ToolTip info(bool extended) const = 0; virtual ToolTip info() const = 0;
int type() const {return QGraphicsItem::UserType + 1;} int type() const {return QGraphicsItem::UserType + 1;}
static void useStyle(bool use) {_useStyle = use;} static void useStyle(bool use) {_useStyle = use;}
@ -22,11 +22,7 @@ protected:
class GraphicsScene : public QGraphicsScene class GraphicsScene : public QGraphicsScene
{ {
public: public:
GraphicsScene(QObject *parent = 0) GraphicsScene(QObject *parent = 0) : QGraphicsScene(parent) {}
: QGraphicsScene(parent), _showExtendedInfo(false) {}
bool showExtendedInfo() const {return _showExtendedInfo;}
void showExtendedInfo(bool show) {_showExtendedInfo = show;}
public slots: public slots:
void clear(); void clear();
@ -35,8 +31,6 @@ protected:
void helpEvent(QGraphicsSceneHelpEvent *event); void helpEvent(QGraphicsSceneHelpEvent *event);
private: private:
bool _showExtendedInfo;
QList<QGraphicsItem *> itemsAtPosition(const QPoint &screenPos, QList<QGraphicsItem *> itemsAtPosition(const QPoint &screenPos,
const QPointF &scenePos, QWidget *widget) const; const QPointF &scenePos, QWidget *widget) const;
}; };

View File

@ -379,9 +379,6 @@ void GraphItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void GraphItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void GraphItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
GraphicsScene *gs = dynamic_cast<GraphicsScene *>(scene()); Popup::show(event->screenPos(), info(), event->widget());
if (gs)
Popup::show(event->screenPos(), info(gs->showExtendedInfo()),
event->widget());
GraphicsItem::mousePressEvent(event); GraphicsItem::mousePressEvent(event);
} }

View File

@ -26,7 +26,7 @@ public:
const QColor &color, Qt::PenStyle style, QGraphicsItem *parent = 0); const QColor &color, Qt::PenStyle style, QGraphicsItem *parent = 0);
virtual ~GraphItem() {} virtual ~GraphItem() {}
virtual ToolTip info(bool extended) const = 0; virtual ToolTip info() const = 0;
QPainterPath shape() const {return _shape;} QPainterPath shape() const {return _shape;}
QRectF boundingRect() const {return _shape.boundingRect();} QRectF boundingRect() const {return _shape.boundingRect();}

View File

@ -1069,8 +1069,6 @@ bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
updateNavigationActions(); updateNavigationActions();
updateStatusBarInfo(); updateStatusBarInfo();
updateWindowTitle(); updateWindowTitle();
if (_files.count() > 1)
_mapView->showExtendedInfo(true);
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
updateRecentFiles(canonicalFileName); updateRecentFiles(canonicalFileName);
#endif // Q_OS_ANDROID #endif // Q_OS_ANDROID
@ -1557,7 +1555,6 @@ void GUI::reloadFiles()
_browser->setCurrent(_files.last()); _browser->setCurrent(_files.last());
#endif // Q_OS_ANDROID #endif // Q_OS_ANDROID
updateDataDEMDownloadAction(); updateDataDEMDownloadAction();
_mapView->showExtendedInfo(_files.size() > 1);
} }
void GUI::closeFiles() void GUI::closeFiles()
@ -1578,7 +1575,6 @@ void GUI::closeFiles()
_lastTab = 0; _lastTab = 0;
_mapView->clear(); _mapView->clear();
_mapView->showExtendedInfo(false);
_files.clear(); _files.clear();
} }

View File

@ -9,10 +9,8 @@ HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
{ {
} }
ToolTip HeartRateGraphItem::info(bool extended) const ToolTip HeartRateGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
QLocale l(QLocale::system()); QLocale l(QLocale::system());

View File

@ -11,7 +11,7 @@ public:
HeartRateGraphItem(const Graph &graph, GraphType type, int width, HeartRateGraphItem(const Graph &graph, GraphType type, int width,
const QColor &color, QGraphicsItem *parent = 0); const QColor &color, QGraphicsItem *parent = 0);
ToolTip info(bool extended) const; ToolTip info() const;
}; };
#endif // HEARTRATEGRAPHITEM_H #endif // HEARTRATEGRAPHITEM_H

View File

@ -71,9 +71,8 @@ static QRectF bbox(const RectC &rect, Map *map, int samples = 100)
return prect; return prect;
} }
ToolTip MapItem::info(bool extended) const ToolTip MapItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
if (!_name.isEmpty()) if (!_name.isEmpty())
@ -213,10 +212,7 @@ void MapItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
update(); update();
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
GraphicsScene *gs = dynamic_cast<GraphicsScene *>(scene()); Popup::show(event->screenPos(), info(), event->widget());
if (gs)
Popup::show(event->screenPos(), info(gs->showExtendedInfo()),
event->widget());
#endif // Q_OS_ANDROID #endif // Q_OS_ANDROID
} }

View File

@ -27,7 +27,7 @@ public:
void setPenStyle(Qt::PenStyle style); void setPenStyle(Qt::PenStyle style);
void setDigitalZoom(int zoom); void setDigitalZoom(int zoom);
ToolTip info(bool extended) const; ToolTip info() const;
signals: signals:
void triggered(); void triggered();

View File

@ -19,6 +19,7 @@
#include "coordinatesitem.h" #include "coordinatesitem.h"
#include "mapitem.h" #include "mapitem.h"
#include "keys.h" #include "keys.h"
#include "graphicsscene.h"
#include "mapaction.h" #include "mapaction.h"
#include "markerinfoitem.h" #include "markerinfoitem.h"
#include "crosshairitem.h" #include "crosshairitem.h"

View File

@ -14,7 +14,6 @@
#include "format.h" #include "format.h"
#include "markerinfoitem.h" #include "markerinfoitem.h"
#include "palette.h" #include "palette.h"
#include "graphicsscene.h"
class QGeoPositionInfoSource; class QGeoPositionInfoSource;
@ -36,6 +35,7 @@ class GraphItem;
class PlaneItem; class PlaneItem;
class MapItem; class MapItem;
class Area; class Area;
class GraphicsScene;
class QTimeZone; class QTimeZone;
class MapAction; class MapAction;
class CrosshairItem; class CrosshairItem;
@ -64,7 +64,6 @@ public:
void setMap(Map *map); void setMap(Map *map);
void setPositionSource(QGeoPositionInfoSource *source); void setPositionSource(QGeoPositionInfoSource *source);
void setGraph(int index); void setGraph(int index);
void showExtendedInfo(bool show) {_scene->showExtendedInfo(show);}
void plot(QPainter *painter, const QRectF &target, qreal scale, void plot(QPainter *painter, const QRectF &target, qreal scale,
PlotFlags flags); PlotFlags flags);

View File

@ -510,9 +510,6 @@ void PathItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void PathItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void PathItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
GraphicsScene *gs = dynamic_cast<GraphicsScene *>(scene()); Popup::show(event->screenPos(), info(), event->widget());
if (gs)
Popup::show(event->screenPos(), info(gs->showExtendedInfo()),
event->widget());
GraphicsItem::mousePressEvent(event); GraphicsItem::mousePressEvent(event);
} }

View File

@ -76,9 +76,6 @@ QRect PathTickItem::tickRect(int value)
void PathTickItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void PathTickItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
const PathItem *pi = static_cast<PathItem*>(parentItem()); const PathItem *pi = static_cast<PathItem*>(parentItem());
GraphicsScene *gs = dynamic_cast<GraphicsScene *>(scene()); Popup::show(event->screenPos(), pi->info(), event->widget());
if (gs)
Popup::show(event->screenPos(), pi->info(gs->showExtendedInfo()),
event->widget());
QGraphicsItem::mousePressEvent(event); QGraphicsItem::mousePressEvent(event);
} }

View File

@ -20,9 +20,9 @@ public:
void setDigitalZoom(int zoom) {setScale(qPow(2, -zoom));} void setDigitalZoom(int zoom) {setScale(qPow(2, -zoom));}
int type() const {return parentItem()->type();} int type() const {return parentItem()->type();}
ToolTip info(bool extended) const ToolTip info() const
{ {
return static_cast<GraphicsItem*>(parentItem())->info(extended); return static_cast<GraphicsItem*>(parentItem())->info();
} }
static QRect tickRect(int value); static QRect tickRect(int value);

View File

@ -9,9 +9,8 @@ PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type, int width,
{ {
} }
ToolTip PowerGraphItem::info(bool extended) const ToolTip PowerGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
QLocale l(QLocale::system()); QLocale l(QLocale::system());

View File

@ -11,7 +11,7 @@ public:
PowerGraphItem(const Graph &graph, GraphType type, int width, PowerGraphItem(const Graph &graph, GraphType type, int width,
const QColor &color, QGraphicsItem *parent = 0); const QColor &color, QGraphicsItem *parent = 0);
ToolTip info(bool extended) const; ToolTip info() const;
}; };
#endif // POWERGRAPHITEM_H #endif // POWERGRAPHITEM_H

View File

@ -1,14 +1,14 @@
#include <QLocale> #include <QPainter>
#include <QFileInfo>
#include "data/waypoint.h" #include "data/waypoint.h"
#include "data/route.h" #include "data/route.h"
#include "map/map.h"
#include "format.h" #include "format.h"
#include "waypointitem.h" #include "waypointitem.h"
#include "tooltip.h" #include "tooltip.h"
#include "routeitem.h" #include "routeitem.h"
ToolTip RouteItem::info(bool extended) const ToolTip RouteItem::info() const
{ {
ToolTip tt; ToolTip tt;
@ -31,13 +31,6 @@ ToolTip RouteItem::info(bool extended) const
} }
tt.insert(tr("Links"), links); tt.insert(tr("Links"), links);
} }
#ifdef Q_OS_ANDROID
Q_UNUSED(extended);
#else // Q_OS_ANDROID
if (extended && !_file.isEmpty())
tt.insert(tr("File"), QString("<a href=\"file:%1\">%2</a>")
.arg(_file, QFileInfo(_file).fileName()));
#endif // Q_OS_ANDROID
return tt; return tt;
} }
@ -55,7 +48,6 @@ RouteItem::RouteItem(const Route &route, Map *map, QGraphicsItem *parent)
_desc = route.description(); _desc = route.description();
_comment = route.comment(); _comment = route.comment();
_links = route.links(); _links = route.links();
_file = route.file();
} }
void RouteItem::setMap(Map *map) void RouteItem::setMap(Map *map)

View File

@ -22,7 +22,7 @@ public:
void showWaypointLabels(bool show); void showWaypointLabels(bool show);
void showWaypointIcons(bool show); void showWaypointIcons(bool show);
ToolTip info(bool extended) const; ToolTip info() const;
QDateTime date() const {return QDateTime();} QDateTime date() const {return QDateTime();}
private: private:
@ -31,7 +31,6 @@ private:
QString _comment; QString _comment;
QVector<Link> _links; QVector<Link> _links;
QVector<WaypointItem*> _waypoints; QVector<WaypointItem*> _waypoints;
QString _file;
}; };
#endif // ROUTEITEM_H #endif // ROUTEITEM_H

View File

@ -15,10 +15,8 @@ SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type, int width,
_mavg = graph.last().last().s() / movingTime; _mavg = graph.last().last().s() / movingTime;
} }
ToolTip SpeedGraphItem::info(bool extended) const ToolTip SpeedGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
qreal scale = (_units == Imperial) ? MS2MIH : (_units == Nautical) qreal scale = (_units == Imperial) ? MS2MIH : (_units == Nautical)
? MS2KN : MS2KMH; ? MS2KN : MS2KMH;

View File

@ -17,7 +17,7 @@ public:
qreal mavg() const {return _mavg;} qreal mavg() const {return _mavg;}
qreal max() const {return _max;} qreal max() const {return _max;}
ToolTip info(bool extended) const; ToolTip info() const;
void setTimeType(TimeType type); void setTimeType(TimeType type);

View File

@ -12,10 +12,8 @@ TemperatureGraphItem::TemperatureGraphItem(const Graph &graph, GraphType type,
_avg = GraphItem::avg(); _avg = GraphItem::avg();
} }
ToolTip TemperatureGraphItem::info(bool extended) const ToolTip TemperatureGraphItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
qreal scale = (_units == Metric) ? 1.0 : C2FS; qreal scale = (_units == Metric) ? 1.0 : C2FS;
qreal offset = (_units == Metric) ? 0 : C2FO; qreal offset = (_units == Metric) ? 0 : C2FO;

View File

@ -15,7 +15,7 @@ public:
qreal min() const {return _min;} qreal min() const {return _min;}
qreal avg() const {return _avg;} qreal avg() const {return _avg;}
ToolTip info(bool extended) const; ToolTip info() const;
private: private:
qreal _min, _max, _avg; qreal _min, _max, _avg;

View File

@ -1,12 +1,12 @@
#include <QLocale> #include <QPainter>
#include "common/util.h" #include "map/map.h"
#include "data/track.h" #include "data/track.h"
#include "format.h" #include "format.h"
#include "tooltip.h" #include "tooltip.h"
#include "trackitem.h" #include "trackitem.h"
ToolTip TrackItem::info(bool extended) const ToolTip TrackItem::info() const
{ {
ToolTip tt; ToolTip tt;
QLocale l; QLocale l;
@ -39,13 +39,6 @@ ToolTip TrackItem::info(bool extended) const
} }
tt.insert(tr("Links"), links); tt.insert(tr("Links"), links);
} }
#ifdef Q_OS_ANDROID
Q_UNUSED(extended);
#else // Q_OS_ANDROID
if (extended && !_file.isEmpty())
tt.insert(tr("File"), QString("<a href=\"file:%1\">%2</a>")
.arg(_file, QFileInfo(_file).fileName()));
#endif // Q_OS_ANDROID
return tt; return tt;
} }
@ -60,5 +53,4 @@ TrackItem::TrackItem(const Track &track, Map *map, QGraphicsItem *parent)
_date = track.date(); _date = track.date();
_time = track.time(); _time = track.time();
_movingTime = track.movingTime(); _movingTime = track.movingTime();
_file = track.file();
} }

View File

@ -15,7 +15,7 @@ class TrackItem : public PathItem
public: public:
TrackItem(const Track &track, Map *map, QGraphicsItem *parent = 0); TrackItem(const Track &track, Map *map, QGraphicsItem *parent = 0);
ToolTip info(bool extended) const; ToolTip info() const;
QDateTime date() const {return _date;} QDateTime date() const {return _date;}
private: private:
@ -26,7 +26,6 @@ private:
QDateTime _date; QDateTime _date;
qreal _time; qreal _time;
qreal _movingTime; qreal _movingTime;
QString _file;
}; };
#endif // TRACKITEM_H #endif // TRACKITEM_H

View File

@ -16,9 +16,8 @@ Units WaypointItem::_units = Metric;
CoordinatesFormat WaypointItem::_format = DecimalDegrees; CoordinatesFormat WaypointItem::_format = DecimalDegrees;
QTimeZone WaypointItem::_timeZone = QTimeZone::utc(); QTimeZone WaypointItem::_timeZone = QTimeZone::utc();
ToolTip WaypointItem::info(bool extended) const ToolTip WaypointItem::info() const
{ {
Q_UNUSED(extended);
ToolTip tt; ToolTip tt;
QLocale l; QLocale l;
@ -275,10 +274,7 @@ void WaypointItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void WaypointItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void WaypointItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
GraphicsScene *gs = dynamic_cast<GraphicsScene *>(scene()); Popup::show(event->screenPos(), info(), event->widget());
if (gs)
Popup::show(event->screenPos(), info(gs->showExtendedInfo()),
event->widget());
/* Do not propagate the event any further as lower stacked items (path /* Do not propagate the event any further as lower stacked items (path
items) would replace the popup with their own popup */ items) would replace the popup with their own popup */
} }

View File

@ -30,7 +30,7 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget); QWidget *widget);
ToolTip info(bool extended) const; ToolTip info() const;
static void setUnits(Units units) {_units = units;} static void setUnits(Units units) {_units = units;}
static void setCoordinatesFormat(CoordinatesFormat format) static void setCoordinatesFormat(CoordinatesFormat format)

View File

@ -137,14 +137,16 @@ QString Util::displayName(const QString &path)
QUrl url(path); QUrl url(path);
// Not an Android URL, return standard filename. // Not an Android URL, return standard filename.
if (url.scheme() != "content") if (url.scheme() != "content") {
return QFileInfo(path).fileName(); QFileInfo fi(path);
return fi.fileName();
// Directory browsing URLs. Those can not be translated using the Android // Directory browsing URLs. Those can not be translated using the Android
// content resolver but we can get the filename from the URL path. // content resolver but we can get the filename from the URL path.
else if (url.path().startsWith("/tree/")) } else if (url.path().startsWith("/tree/")) {
return QFileInfo(url.fileName()).fileName(); QFileInfo fi(url.fileName());
return fi.fileName();
// Translate all "regular" android URLs using the Android content resolver. // Translate all "regular" android URLs using the Android content resolver.
else } else
return documentName(path); return documentName(path);
#else #else
return path; return path;

View File

@ -86,7 +86,7 @@ bool CUPParser::waypoint(const QByteArrayList &entry,
return true; return true;
} }
bool CUPParser::task(const QString &fileName, const QByteArrayList &entry, bool CUPParser::task(const QByteArrayList &entry,
const QVector<Waypoint> &waypoints, QList<RouteData> &routes) const QVector<Waypoint> &waypoints, QList<RouteData> &routes)
{ {
if (entry.size() < 3) { if (entry.size() < 3) {
@ -96,7 +96,6 @@ bool CUPParser::task(const QString &fileName, const QByteArrayList &entry,
RouteData r; RouteData r;
r.setName(entry.at(0)); r.setName(entry.at(0));
r.setFile(fileName);
for (int i = 1; i < entry.size(); i++) { for (int i = 1; i < entry.size(); i++) {
if (entry.at(i) == "???") if (entry.at(i) == "???")
continue; continue;
@ -156,7 +155,7 @@ bool CUPParser::parse(QFile *file, QList<TrackData> &tracks,
return false; return false;
} else if (segment == Tasks) { } else if (segment == Tasks) {
if (entry.at(0) != "Options" && !entry.at(0).startsWith("ObsZone=") if (entry.at(0) != "Options" && !entry.at(0).startsWith("ObsZone=")
&& !task(file->fileName(), entry, waypoints, routes)) && !task(entry, waypoints, routes))
return false; return false;
} }

View File

@ -15,8 +15,8 @@ public:
private: private:
bool waypoint(const QByteArrayList &entry, QVector<Waypoint> &waypoints); bool waypoint(const QByteArrayList &entry, QVector<Waypoint> &waypoints);
bool task(const QString &fileName, const QByteArrayList &entry, bool task(const QByteArrayList &entry, const QVector<Waypoint> &waypoints,
const QVector<Waypoint> &waypoints, QList<RouteData> &routes); QList<RouteData> &routes);
QString _errorString; QString _errorString;
int _errorLine; int _errorLine;

View File

@ -481,7 +481,6 @@ bool FITParser::parse(QFile *file, QList<TrackData> &tracks,
return false; return false;
tracks.append(ctx.segment); tracks.append(ctx.segment);
tracks.last().setFile(file->fileName());
return true; return true;
} }

View File

@ -330,7 +330,7 @@ bool GeoJSONParser::multiPoint(const QJsonObject &object,
return true; return true;
} }
bool GeoJSONParser::lineString(const QJsonObject &object, const QString &file, bool GeoJSONParser::lineString(const QJsonObject &object,
const Projection &parent, const QJsonValue &properties, const Projection &parent, const QJsonValue &properties,
QList<TrackData> &tracks) QList<TrackData> &tracks)
{ {
@ -367,7 +367,6 @@ bool GeoJSONParser::lineString(const QJsonObject &object, const QString &file,
setSegmentProperties(segment, -1, properties); setSegmentProperties(segment, -1, properties);
TrackData track(segment); TrackData track(segment);
track.setFile(file);
setTrackProperties(track, properties); setTrackProperties(track, properties);
tracks.append(track); tracks.append(track);
@ -375,7 +374,7 @@ bool GeoJSONParser::lineString(const QJsonObject &object, const QString &file,
} }
bool GeoJSONParser::multiLineString(const QJsonObject &object, bool GeoJSONParser::multiLineString(const QJsonObject &object,
const QString &file, const Projection &parent, const QJsonValue &properties, const Projection &parent, const QJsonValue &properties,
QList<TrackData> &tracks) QList<TrackData> &tracks)
{ {
if (!object.contains("coordinates")) { if (!object.contains("coordinates")) {
@ -422,7 +421,6 @@ bool GeoJSONParser::multiLineString(const QJsonObject &object,
} }
} }
track.setFile(file);
setTrackProperties(track, properties); setTrackProperties(track, properties);
tracks.append(track); tracks.append(track);
@ -541,7 +539,7 @@ bool GeoJSONParser::multiPolygon(const QJsonObject &object,
} }
bool GeoJSONParser::geometryCollection(const QJsonObject &object, bool GeoJSONParser::geometryCollection(const QJsonObject &object,
const QString &file, const Projection &parent, const QJsonValue &properties, const Projection &parent, const QJsonValue &properties,
QList<TrackData> &tracks, QList<Area> &areas, QVector<Waypoint> &waypoints) QList<TrackData> &tracks, QList<Area> &areas, QVector<Waypoint> &waypoints)
{ {
if (!object["geometries"].isArray()) { if (!object["geometries"].isArray()) {
@ -569,13 +567,13 @@ bool GeoJSONParser::geometryCollection(const QJsonObject &object,
return false; return false;
break; break;
case LineString: case LineString:
if (!lineString(geometry, file, PROJ(proj, parent), properties, if (!lineString(geometry, PROJ(proj, parent), properties,
tracks)) tracks))
return false; return false;
break; break;
case MultiLineString: case MultiLineString:
if (!multiLineString(geometry, file, PROJ(proj, parent), if (!multiLineString(geometry, PROJ(proj, parent), properties,
properties, tracks)) tracks))
return false; return false;
break; break;
case Polygon: case Polygon:
@ -588,7 +586,7 @@ bool GeoJSONParser::geometryCollection(const QJsonObject &object,
return false; return false;
break; break;
case GeometryCollection: case GeometryCollection:
if (!geometryCollection(geometry, file, PROJ(proj, parent), if (!geometryCollection(geometry, PROJ(proj, parent),
properties, tracks, areas, waypoints)) properties, tracks, areas, waypoints))
return false; return false;
break; break;
@ -602,9 +600,8 @@ bool GeoJSONParser::geometryCollection(const QJsonObject &object,
return true; return true;
} }
bool GeoJSONParser::feature(const QJsonObject &object, const QString &file, bool GeoJSONParser::feature(const QJsonObject &object, const Projection &parent,
const Projection &parent, QList<TrackData> &tracks, QList<Area> &areas, QList<TrackData> &tracks, QList<Area> &areas, QVector<Waypoint> &waypoints)
QVector<Waypoint> &waypoints)
{ {
if (object["geometry"].isNull()) if (object["geometry"].isNull())
return true; return true;
@ -626,14 +623,13 @@ bool GeoJSONParser::feature(const QJsonObject &object, const QString &file,
return multiPoint(geometry, PROJ(proj, parent), properties, return multiPoint(geometry, PROJ(proj, parent), properties,
waypoints); waypoints);
case LineString: case LineString:
return lineString(geometry, file, PROJ(proj, parent), properties, return lineString(geometry, PROJ(proj, parent), properties, tracks);
tracks);
case MultiLineString: case MultiLineString:
return multiLineString(geometry, file, PROJ(proj, parent), return multiLineString(geometry, PROJ(proj, parent), properties,
properties, tracks); tracks);
case GeometryCollection: case GeometryCollection:
return geometryCollection(geometry, file, PROJ(proj, parent), return geometryCollection(geometry, PROJ(proj, parent), properties,
properties, tracks, areas, waypoints); tracks, areas, waypoints);
case Polygon: case Polygon:
return polygon(geometry, PROJ(proj, parent), properties, areas); return polygon(geometry, PROJ(proj, parent), properties, areas);
case MultiPolygon: case MultiPolygon:
@ -646,8 +642,8 @@ bool GeoJSONParser::feature(const QJsonObject &object, const QString &file,
} }
bool GeoJSONParser::featureCollection(const QJsonObject &object, bool GeoJSONParser::featureCollection(const QJsonObject &object,
const QString &file, const Projection &parent, QList<TrackData> &tracks, const Projection &parent, QList<TrackData> &tracks, QList<Area> &areas,
QList<Area> &areas, QVector<Waypoint> &waypoints) QVector<Waypoint> &waypoints)
{ {
if (!object["features"].isArray()) { if (!object["features"].isArray()) {
_errorString = "Invalid/missing FeatureCollection features array"; _errorString = "Invalid/missing FeatureCollection features array";
@ -660,8 +656,8 @@ bool GeoJSONParser::featureCollection(const QJsonObject &object,
return false; return false;
for (int i = 0; i < features.size(); i++) for (int i = 0; i < features.size(); i++)
if (!feature(features.at(i).toObject(), file, PROJ(proj, parent), if (!feature(features.at(i).toObject(), PROJ(proj, parent), tracks,
tracks, areas, waypoints)) areas, waypoints))
return false; return false;
return true; return true;
@ -690,7 +686,6 @@ bool GeoJSONParser::parse(QFile *file, QList<TrackData> &tracks,
QJsonObject object(doc.object()); QJsonObject object(doc.object());
Projection proj(GCS::WGS84()); Projection proj(GCS::WGS84());
QString fileName(file->fileName());
switch (type(object)) { switch (type(object)) {
case Point: case Point:
@ -698,17 +693,16 @@ bool GeoJSONParser::parse(QFile *file, QList<TrackData> &tracks,
case MultiPoint: case MultiPoint:
return multiPoint(object, proj, QJsonValue(), waypoints); return multiPoint(object, proj, QJsonValue(), waypoints);
case LineString: case LineString:
return lineString(object, fileName, proj, QJsonValue(), tracks); return lineString(object, proj, QJsonValue(), tracks);
case MultiLineString: case MultiLineString:
return multiLineString(object, fileName, proj, QJsonValue(), tracks); return multiLineString(object, proj, QJsonValue(), tracks);
case GeometryCollection: case GeometryCollection:
return geometryCollection(object, fileName, proj, QJsonValue(), return geometryCollection(object, proj, QJsonValue(), tracks, areas,
tracks, areas, waypoints);
case Feature:
return feature(object, fileName, proj, tracks, areas, waypoints);
case FeatureCollection:
return featureCollection(object, fileName, proj, tracks, areas,
waypoints); waypoints);
case Feature:
return feature(object, proj, tracks, areas, waypoints);
case FeatureCollection:
return featureCollection(object, proj, tracks, areas, waypoints);
case Polygon: case Polygon:
return polygon(object, proj, QJsonValue(), areas); return polygon(object, proj, QJsonValue(), areas);
case MultiPolygon: case MultiPolygon:

View File

@ -37,25 +37,22 @@ private:
const QJsonValue &properties, QVector<Waypoint> &waypoints); const QJsonValue &properties, QVector<Waypoint> &waypoints);
bool multiPoint(const QJsonObject &object, const Projection &parent, bool multiPoint(const QJsonObject &object, const Projection &parent,
const QJsonValue &properties, QVector<Waypoint> &waypoints); const QJsonValue &properties, QVector<Waypoint> &waypoints);
bool lineString(const QJsonObject &coordinates, const QString &file, bool lineString(const QJsonObject &coordinates, const Projection &parent,
const Projection &parent, const QJsonValue &properties, const QJsonValue &properties, QList<TrackData> &tracks);
QList<TrackData> &tracks); bool multiLineString(const QJsonObject &object, const Projection &proj,
bool multiLineString(const QJsonObject &object, const QString &file, const QJsonValue &properties, QList<TrackData> &tracks);
const Projection &proj, const QJsonValue &properties,
QList<TrackData> &tracks);
bool polygon(const QJsonObject &object, const Projection &parent, bool polygon(const QJsonObject &object, const Projection &parent,
const QJsonValue &properties, QList<Area> &areas); const QJsonValue &properties, QList<Area> &areas);
bool multiPolygon(const QJsonObject &object, const Projection &proj, bool multiPolygon(const QJsonObject &object, const Projection &proj,
const QJsonValue &properties, QList<Area> &areas); const QJsonValue &properties, QList<Area> &areas);
bool geometryCollection(const QJsonObject &json, const QString &file, bool geometryCollection(const QJsonObject &json, const Projection &parent,
const Projection &parent, const QJsonValue &properties, const QJsonValue &properties, QList<TrackData> &tracks,
QList<Area> &areas, QVector<Waypoint> &waypoints);
bool feature(const QJsonObject &json, const Projection &parent,
QList<TrackData> &tracks, QList<Area> &areas,
QVector<Waypoint> &waypoints);
bool featureCollection(const QJsonObject &object, const Projection &parent,
QList<TrackData> &tracks, QList<Area> &areas, QVector<Waypoint> &waypoints); QList<TrackData> &tracks, QList<Area> &areas, QVector<Waypoint> &waypoints);
bool feature(const QJsonObject &json, const QString &file,
const Projection &parent, QList<TrackData> &tracks, QList<Area> &areas,
QVector<Waypoint> &waypoints);
bool featureCollection(const QJsonObject &object, const QString &file,
const Projection &parent, QList<TrackData> &tracks, QList<Area> &areas,
QVector<Waypoint> &waypoints);
QString _errorString; QString _errorString;
}; };

View File

@ -343,10 +343,6 @@ void GPXParser::track(TrackData &track)
if (!link10.URL().isEmpty()) if (!link10.URL().isEmpty())
track.addLink(link10); track.addLink(link10);
QFile *file = qobject_cast<QFile *>(_reader.device());
if (file)
track.setFile(file->fileName());
} }
void GPXParser::area(Area &area) void GPXParser::area(Area &area)
@ -392,9 +388,6 @@ void GPXParser::gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
track(tracks.back()); track(tracks.back());
} else if (_reader.name() == QLatin1String("rte")) { } else if (_reader.name() == QLatin1String("rte")) {
routes.append(RouteData()); routes.append(RouteData());
QFile *file = qobject_cast<QFile *>(_reader.device());
if (file)
routes.back().setFile(file->fileName());
routepoints(routes.back(), tracks); routepoints(routes.back(), tracks);
} else if (_reader.name() == QLatin1String("wpt")) { } else if (_reader.name() == QLatin1String("wpt")) {
waypoints.append(Waypoint(coordinates())); waypoints.append(Waypoint(coordinates()));

View File

@ -237,7 +237,6 @@ bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
} else { } else {
route = true; route = true;
routes.append(RouteData()); routes.append(RouteData());
routes.last().setFile(file->fileName());
} }
} else if (line[0] == 'B') { } else if (line[0] == 'B') {
if (ctx.date.isNull()) { if (ctx.date.isNull()) {
@ -249,7 +248,6 @@ bool IGCParser::parse(QFile *file, QList<TrackData> &tracks,
} }
if (!track) { if (!track) {
tracks.append(SegmentData()); tracks.append(SegmentData());
tracks.last().setFile(file->fileName());
ctx.time = QTime(0, 0); ctx.time = QTime(0, 0);
track = true; track = true;
} }

View File

@ -40,7 +40,6 @@ bool ITNParser::parse(QFile *file, QList<TrackData> &tracks,
_errorLine++; _errorLine++;
} }
rd.setFile(file->fileName());
routes.append(rd); routes.append(rd);
return true; return true;

View File

@ -594,8 +594,8 @@ void KMLParser::photoOverlay(const Ctx &ctx, QVector<Waypoint> &waypoints,
} }
} }
void KMLParser::multiGeometry(const Ctx &ctx, QList<TrackData> &tracks, void KMLParser::multiGeometry(QList<TrackData> &tracks, QList<Area> &areas,
QList<Area> &areas, QVector<Waypoint> &waypoints) QVector<Waypoint> &waypoints)
{ {
TrackData *tp = 0; TrackData *tp = 0;
Area *ap = 0; Area *ap = 0;
@ -608,7 +608,6 @@ void KMLParser::multiGeometry(const Ctx &ctx, QList<TrackData> &tracks,
} else if (_reader.name() == QLatin1String("LineString")) { } else if (_reader.name() == QLatin1String("LineString")) {
if (!tp) { if (!tp) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(ctx.path);
tp = &tracks.last(); tp = &tracks.last();
} }
tp->append(SegmentData()); tp->append(SegmentData());
@ -652,24 +651,21 @@ void KMLParser::placemark(const Ctx &ctx, QList<TrackData> &tracks,
} else if (_reader.name() == QLatin1String("StyleMap")) } else if (_reader.name() == QLatin1String("StyleMap"))
styleMap(map); styleMap(map);
else if (_reader.name() == QLatin1String("MultiGeometry")) else if (_reader.name() == QLatin1String("MultiGeometry"))
multiGeometry(ctx, tracks, areas, waypoints); multiGeometry(tracks, areas, waypoints);
else if (_reader.name() == QLatin1String("Point")) { else if (_reader.name() == QLatin1String("Point")) {
waypoints.append(Waypoint()); waypoints.append(Waypoint());
point(waypoints.last()); point(waypoints.last());
} else if (_reader.name() == QLatin1String("LineString") } else if (_reader.name() == QLatin1String("LineString")
|| _reader.name() == QLatin1String("LinearRing")) { || _reader.name() == QLatin1String("LinearRing")) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(ctx.path);
tracks.last().append(SegmentData()); tracks.last().append(SegmentData());
lineString(tracks.last().last()); lineString(tracks.last().last());
} else if (_reader.name() == QLatin1String("Track")) { } else if (_reader.name() == QLatin1String("Track")) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(ctx.path);
tracks.last().append(SegmentData()); tracks.last().append(SegmentData());
track(tracks.last().last()); track(tracks.last().last());
} else if (_reader.name() == QLatin1String("MultiTrack")) { } else if (_reader.name() == QLatin1String("MultiTrack")) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(ctx.path);
multiTrack(tracks.last()); multiTrack(tracks.last());
} else if (_reader.name() == QLatin1String("Polygon")) { } else if (_reader.name() == QLatin1String("Polygon")) {
areas.append(Area()); areas.append(Area());

View File

@ -40,8 +40,8 @@ private:
QVector<Waypoint> &waypoints, PointStyleMap &pointStyles, QVector<Waypoint> &waypoints, PointStyleMap &pointStyles,
PolygonStyleMap &polyStyles, LineStyleMap &lineStyles, PolygonStyleMap &polyStyles, LineStyleMap &lineStyles,
QMap<QString, QString> &map); QMap<QString, QString> &map);
void multiGeometry(const Ctx &ctx, QList<TrackData> &tracks, void multiGeometry(QList<TrackData> &tracks, QList<Area> &areas,
QList<Area> &areas, QVector<Waypoint> &waypoints); QVector<Waypoint> &waypoints);
void photoOverlay(const Ctx &ctx, QVector<Waypoint> &waypoints, void photoOverlay(const Ctx &ctx, QVector<Waypoint> &waypoints,
PointStyleMap &pointStyles, QMap<QString, QString> &map); PointStyleMap &pointStyles, QMap<QString, QString> &map);
void track(SegmentData &segment); void track(SegmentData &segment);

View File

@ -531,7 +531,6 @@ bool NMEAParser::parse(QFile *file, QList<TrackData> &tracks,
if (segment.size()) { if (segment.size()) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(file->fileName());
tracks.last().append(segment); tracks.last().append(segment);
} }

View File

@ -276,7 +276,6 @@ bool GHPParser::parse(QFile *file, QList<TrackData> &tracks,
} }
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(file->fileName());
tracks.last().append(segment); tracks.last().append(segment);
return true; return true;

View File

@ -41,7 +41,6 @@ bool PLTParser::parse(QFile *file, QList<TrackData> &tracks,
tracks.append(TrackData()); tracks.append(TrackData());
TrackData &track = tracks.last(); TrackData &track = tracks.last();
track.setFile(file->fileName());
track.append(SegmentData()); track.append(SegmentData());
SegmentData &segment = track.last(); SegmentData &segment = track.last();
@ -160,7 +159,6 @@ bool RTEParser::parse(QFile *file, QList<TrackData> &tracks,
if (list.at(0).trimmed() == "R") { if (list.at(0).trimmed() == "R") {
routes.append(RouteData()); routes.append(RouteData());
routes.last().setFile(file->fileName());
record = true; record = true;
if (list.size() >= 3) { if (list.size() >= 3) {

View File

@ -23,7 +23,6 @@ public:
const QString &comment() const {return _data.comment();} const QString &comment() const {return _data.comment();}
const QVector<Link> &links() const {return _data.links();} const QVector<Link> &links() const {return _data.links();}
const LineStyle &style() const {return _data.style();} const LineStyle &style() const {return _data.style();}
const QString &file() const {return _data.file();}
bool isValid() const {return _data.size() >= 2;} bool isValid() const {return _data.size() >= 2;}

View File

@ -15,20 +15,17 @@ public:
const QString &comment() const {return _comment;} const QString &comment() const {return _comment;}
const QVector<Link> &links() const {return _links;} const QVector<Link> &links() const {return _links;}
const LineStyle &style() const {return _style;} const LineStyle &style() const {return _style;}
const QString &file() const {return _file;}
void setName(const QString &name) {_name = name;} void setName(const QString &name) {_name = name;}
void setDescription(const QString &desc) {_desc = desc;} void setDescription(const QString &desc) {_desc = desc;}
void setComment(const QString &comment) {_comment = comment;} void setComment(const QString &comment) {_comment = comment;}
void addLink(const Link &link) {_links.append(link);} void addLink(const Link &link) {_links.append(link);}
void setStyle(const LineStyle &style) {_style = style;} void setStyle(const LineStyle &style) {_style = style;}
void setFile(const QString &file) {_file = file;}
private: private:
QString _name; QString _name;
QString _desc; QString _desc;
QString _comment; QString _comment;
QString _file;
QVector<Link> _links; QVector<Link> _links;
LineStyle _style; LineStyle _style;
}; };

View File

@ -109,7 +109,6 @@ bool SLFParser::parse(QFile *file, QList<TrackData> &tracks,
if (_reader.readNextStartElement()) { if (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("Activity")) { if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData()); tracks.append(TrackData());
tracks.last().setFile(file->fileName());
activity(tracks.last()); activity(tracks.last());
} else } else
_reader.raiseError("Not a SLF file"); _reader.raiseError("Not a SLF file");

View File

@ -136,9 +136,6 @@ void SMLParser::sml(QList<TrackData> &tracks)
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("DeviceLog")) { if (_reader.name() == QLatin1String("DeviceLog")) {
tracks.append(TrackData()); tracks.append(TrackData());
QFile *file = qobject_cast<QFile*>(_reader.device());
if (file)
tracks.last().setFile(file->fileName());
deviceLog(tracks.last()); deviceLog(tracks.last());
} else } else
_reader.skipCurrentElement(); _reader.skipCurrentElement();

View File

@ -196,10 +196,7 @@ void TCXParser::courses(QList<TrackData> &tracks, QVector<Waypoint> &waypoints)
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("Course")) { if (_reader.name() == QLatin1String("Course")) {
tracks.append(TrackData()); tracks.append(TrackData());
QFile *file = qobject_cast<QFile*>(_reader.device()); course(waypoints, tracks.back());
if (file)
tracks.last().setFile(file->fileName());
course(waypoints, tracks.last());
} else } else
_reader.skipCurrentElement(); _reader.skipCurrentElement();
} }
@ -210,9 +207,6 @@ void TCXParser::sport(QList<TrackData> &tracks)
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("Activity")) { if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData()); tracks.append(TrackData());
QFile *file = qobject_cast<QFile*>(_reader.device());
if (file)
tracks.last().setFile(file->fileName());
activity(tracks.last()); activity(tracks.last());
} else } else
_reader.skipCurrentElement(); _reader.skipCurrentElement();
@ -235,9 +229,6 @@ void TCXParser::activities(QList<TrackData> &tracks)
while (_reader.readNextStartElement()) { while (_reader.readNextStartElement()) {
if (_reader.name() == QLatin1String("Activity")) { if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData()); tracks.append(TrackData());
QFile *file = qobject_cast<QFile*>(_reader.device());
if (file)
tracks.last().setFile(file->fileName());
activity(tracks.last()); activity(tracks.last());
} else if (_reader.name() == QLatin1String("MultiSportSession")) } else if (_reader.name() == QLatin1String("MultiSportSession"))
multiSportSession(tracks); multiSportSession(tracks);

View File

@ -36,7 +36,6 @@ public:
const QString &comment() const {return _data.comment();} const QString &comment() const {return _data.comment();}
const QVector<Link> &links() const {return _data.links();} const QVector<Link> &links() const {return _data.links();}
const LineStyle &style() const {return _data.style();} const LineStyle &style() const {return _data.style();}
const QString &file() const {return _data.file();}
bool isValid() const; bool isValid() const;

View File

@ -25,20 +25,17 @@ public:
const QString &comment() const {return _comment;} const QString &comment() const {return _comment;}
const QVector<Link> &links() const {return _links;} const QVector<Link> &links() const {return _links;}
const LineStyle &style() const {return _style;} const LineStyle &style() const {return _style;}
const QString &file() const {return _file;}
void setName(const QString &name) {_name = name;} void setName(const QString &name) {_name = name;}
void setDescription(const QString &desc) {_desc = desc;} void setDescription(const QString &desc) {_desc = desc;}
void setComment(const QString &comment) {_comment = comment;} void setComment(const QString &comment) {_comment = comment;}
void addLink(const Link &link) {_links.append(link);} void addLink(const Link &link) {_links.append(link);}
void setStyle(const LineStyle &style) {_style = style;} void setStyle(const LineStyle &style) {_style = style;}
void setFile(const QString &path) {_file = path;}
private: private:
QString _name; QString _name;
QString _desc; QString _desc;
QString _comment; QString _comment;
QString _file;
QVector<Link> _links; QVector<Link> _links;
LineStyle _style; LineStyle _style;
}; };

View File

@ -152,7 +152,6 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
if (!track) { if (!track) {
tracks.append(SegmentData()); tracks.append(SegmentData());
tracks.last().setFile(file->fileName());
track = true; track = true;
} }
@ -206,7 +205,6 @@ bool TwoNavParser::parse(QFile *file, QList<TrackData> &tracks,
case 'R': case 'R':
{QStringList list(codec.toString(line).split(',')); {QStringList list(codec.toString(line).split(','));
routes.append(RouteData()); routes.append(RouteData());
routes.last().setFile(file->fileName());
if (list.size() > 1) if (list.size() > 1)
routes.last().setName(list.at(1)); routes.last().setName(list.at(1));
route = true;} route = true;}