From f39596df0628c567f2ffd45cfa5fe809fbb7cf75 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 8 Oct 2018 19:01:45 +0200 Subject: Map: remove access to displayed_dive_site in GPS-filter model The location information shows a list of dive sites at the same location as the edited dive site. This was done by passing a function to an "SsrfSortFilterProxyModel". Unfortunately, the latter does only support function pointers without state and therefore had to access the global "displayed_dive_site" object. Replace the SsrfSortFilterProxyModel by a proper subclass of QSortFilterProxyModel that contains information on the position and id of the currently edited dive site. Update the filter model if the location of the dive site changes. This introduces a behavioral change: editing the GPS location will lead to an updated list. Signed-off-by: Berthold Stoeger --- desktop-widgets/locationinformation.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'desktop-widgets/locationinformation.h') diff --git a/desktop-widgets/locationinformation.h b/desktop-widgets/locationinformation.h index 225414b2f..868ea729e 100644 --- a/desktop-widgets/locationinformation.h +++ b/desktop-widgets/locationinformation.h @@ -4,6 +4,7 @@ #include "core/units.h" #include "ui_locationInformation.h" +#include "qt-models/divelocationmodel.h" #include #include #include @@ -48,6 +49,7 @@ private: Ui::LocationInformation ui; bool modified; QAction *acceptAction, *rejectAction; + GPSLocationInformationModel filter_model; }; class DiveLocationFilterProxyModel : public QSortFilterProxyModel { -- cgit v1.2.3-70-g09d2