Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GUI map preview #1385

Merged
merged 14 commits into from
Nov 18, 2024
Merged

Refactor GUI map preview #1385

merged 14 commits into from
Nov 18, 2024

Conversation

tsteven4
Copy link
Collaborator

Among other cleanups this enforces storage of which map items are visible to GMapDlg::model_. Duplication of this information, for example in GpxItem::visible, has been eliminated. This allows simplification as we can often use common routines passing a parent or child of the model instead of separate routine for wayoints/tracks/routes. It also improves maintainability and correctness as the possibility of disagreement is eliminated (which could occur previously). It allows GMapDlg::gpx_ to be const, which ensures we aren't operating on copies of information, as we were in GMapDialog::[show|hide[AllWaypoints|Track|Routes (although the code worked anyway, the operation on the temporary copy was just obfuscation. Overall we are down 347 LOCs.

This started as remove of foreach. That is readily achievable in the GUI, but fraught with peril in the CLI due to routines that operate on global lists that you may be iterating over.

I still need to turn debug off before merging.

@GPSBabelDeveloper
Copy link
Collaborator

GPSBabelDeveloper commented Nov 17, 2024 via email

"Show Only This ..." will pan to the selected waypoint or frame the
selected track or route.
"Show All ..." will recenter the map and reset the bounds.
@tsteven4 tsteven4 merged commit 186ed56 into GPSBabel:master Nov 18, 2024
18 checks passed
@tsteven4 tsteven4 deleted the mappre branch November 18, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants