Skip to content

Commit

Permalink
ws
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteven4 committed Nov 18, 2024
1 parent db3c766 commit 2fd8058
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
8 changes: 4 additions & 4 deletions gui/gmapdlg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ GMapDialog::GMapDialog(QWidget* parent, const Gpx& mapData, QPlainTextEdit* te):
ui_.treeView->setModel(model_);
ui_.treeView->setExpandsOnDoubleClick(false);
connect(model_, &QStandardItemModel::itemChanged,
this, &GMapDialog::itemChangedX);
this, &GMapDialog::itemChangedX);
connect(mapWidget_, &Map::waypointClicked, this, [this](int i)->void {
itemClickedX(wptItem_->child(i));
});
Expand Down Expand Up @@ -222,7 +222,7 @@ void GMapDialog::showHideChild(const QStandardItem* child)
int row = child->row();
if (top == wptItem_) {
mapWidget_->setWaypointVisibility(row, show);
} else if (top == trkItem_) {
} else if (top == trkItem_) {
mapWidget_->setTrackVisibility(row, show);
} else if (top == rteItem_) {
mapWidget_->setRouteVisibility(row, show);
Expand Down Expand Up @@ -291,7 +291,7 @@ void GMapDialog::itemClickedX(const QStandardItem* it)
}

//-------------------------------------------------------------------------
void GMapDialog::selectionChangedX(const QItemSelection& sel, const QItemSelection& desel)
void GMapDialog::selectionChangedX(const QItemSelection& sel, const QItemSelection& desel)
{
if constexpr(debug_) {
qDebug() << "selectionChangedX";
Expand Down Expand Up @@ -403,7 +403,7 @@ void GMapDialog::showContextMenu(const QPoint& pt)
tr("Collapse All")
};
showTopContextMenu(labels, it, pt);
} else if (it != nullptr) {
} else if (it != nullptr) {
QStandardItem* parent = it->parent();
if (parent == wptItem_) {
showChildContextMenu(tr("Show Only This Waypoint"), it, pt);
Expand Down
3 changes: 1 addition & 2 deletions gui/gmapdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class GMapDialog: public QDialog
private slots:
void itemChangedX(QStandardItem* it);
void treeDoubleClicked(const QModelIndex& idx);
void selectionChangedX(const QItemSelection& sel, const QItemSelection& desel);
void selectionChangedX(const QItemSelection& sel, const QItemSelection& desel);
void showContextMenu(const QPoint& pt);
};

#endif
2 changes: 1 addition & 1 deletion gui/gpx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ QString Gpx::read(const QString& fileName)
QXmlStreamReader reader(&file);
GpxHandler gpxHandler;

for (bool atEnd = false; !reader.atEnd() && !atEnd;) {
for (bool atEnd = false; !reader.atEnd() && !atEnd;) {
reader.readNext();
// do processing
switch (reader.tokenType()) {
Expand Down
12 changes: 5 additions & 7 deletions gui/gpx.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class GpxTrackPoint

private:
LatLng location;
double elevation{0.0};
double elevation{0.0};
QDateTime dateTime;
};

Expand Down Expand Up @@ -258,7 +258,7 @@ class GpxTrack
}

private:
int number{1};
int number{1};
QString name;
QString comment;
QString description;
Expand Down Expand Up @@ -332,7 +332,7 @@ class GpxWaypoint

private:
LatLng location_;
double elevation_{-1.0E-100};
double elevation_{-1.0E-100};
QString name_;
QString comment_;
QString description_;
Expand Down Expand Up @@ -362,9 +362,7 @@ class Gpx

private:
QList <GpxWaypoint> wayPoints;
QList <GpxTrack> tracks;
QList <GpxRoute> routes;
QList <GpxTrack> tracks;
QList <GpxRoute> routes;
};


#endif
6 changes: 3 additions & 3 deletions gui/map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static QString stripDoubleQuotes(const QString& s)

//------------------------------------------------------------------------
Map::Map(QWidget* parent,
const Gpx& gpx, QPlainTextEdit* te):
const Gpx& gpx, QPlainTextEdit* te):
QWebEngineView(parent),
gpx_(gpx),
textEdit_(te)
Expand All @@ -83,7 +83,7 @@ Map::Map(QWidget* parent,
// 1. In the file system in the same directory as the executable.
// 2. In the Qt resource system. This is useful if the resource was compiled
// into the executable.
QString baseFile = QApplication::applicationDirPath() + "/gmapbase.html";
QString baseFile = QApplication::applicationDirPath() + "/gmapbase.html";
QString fileName;
QUrl baseUrl;
if (QFile(baseFile).exists()) {
Expand Down Expand Up @@ -186,7 +186,7 @@ void Map::loadFinishedX(bool f)
//------------------------------------------------------------------------
static QString fmtLatLng(const LatLng& l)
{
return QString("{lat: %1, lng: %3}").arg(l.lat(), 0, 'f', 5) .arg(l.lng(), 0, 'f', 5);
return QString("{lat: %1, lng: %3}").arg(l.lat(), 0, 'f', 5) .arg(l.lng(), 0, 'f', 5);
}

//------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gui/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Map : public QWebEngineView
Q_OBJECT
public:
Map(QWidget* parent,
const Gpx& gpx_, QPlainTextEdit* textEdit_);
const Gpx& gpx_, QPlainTextEdit* textEdit_);
~Map();

void showGpxData();
Expand Down

0 comments on commit 2fd8058

Please sign in to comment.