diff options
author | 2019-05-03 23:37:42 +0200 | |
---|---|---|
committer | 2019-05-11 12:06:19 -0700 | |
commit | cd5489e08d4c76b96ae0d388d9efea24134dde8d (patch) | |
tree | a57304f2df8f331a76627b84259013aee70cbb11 /qt-models/maplocationmodel.cpp | |
parent | d29f82c52d604ddf65476bf382d4bbf1b5634525 (diff) | |
download | subsurface-cd5489e08d4c76b96ae0d388d9efea24134dde8d.tar.gz |
Map: in dive-site-edit mode, select those maps we filter for
When dive sites are edited, we shouldn't highlight the sites
of the current dive, but the currently edited site(s).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/maplocationmodel.cpp')
-rw-r--r-- | qt-models/maplocationmodel.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index 1e0fd9c81..1fdedf807 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -136,8 +136,11 @@ void MapLocationModel::reload() #else // In dive site mode (that is when either editing a dive site or on // the dive site tab), we want to show all dive sites, not only those - // of the non-hidden dives. + // of the non-hidden dives. Moreover, the selected dive sites are those + // that we filter for. bool diveSiteMode = MultiFilterSortModel::instance()->diveSiteMode(); + if (diveSiteMode) + m_selectedDs = MultiFilterSortModel::instance()->filteredDiveSites(); #endif for_each_dive(idx, dive) { // Don't show dive sites of hidden dives, unless this is the currently @@ -147,7 +150,7 @@ void MapLocationModel::reload() struct dive_site *ds = get_dive_site_for_dive(dive); if (!dive_site_has_gps_location(ds)) continue; - if (dive->selected && !m_selectedDs.contains(ds)) + if (!diveSiteMode && dive->selected && !m_selectedDs.contains(ds)) m_selectedDs.append(ds); if (locations.contains(ds)) continue; |