From 065423896dee0fe1cc6e2bd13e7e8d1b1cb3e181 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 5 May 2019 12:18:04 +0200 Subject: Filter: add reference counting for dive-site mode The dive-site-edit and dive-site-table tabs both put the filter into a special dive-site mode. When switching between both, it could happen that the one got its show befor the other got its hide event. Thus, the first would start dive-site filtering and the second stop it. Now the app was not in filter mode even though it should. To solve this problem, add reference counting for the filter's dive-site mode. In both tabs call the enter/exit functions on show/hide. In the dive-site-table tab, when the selection changes, use a set function that doesn't modify the reference count. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/TabDiveSite.h | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets/tab-widgets/TabDiveSite.h') diff --git a/desktop-widgets/tab-widgets/TabDiveSite.h b/desktop-widgets/tab-widgets/TabDiveSite.h index 2f831f71c..ead94af5b 100644 --- a/desktop-widgets/tab-widgets/TabDiveSite.h +++ b/desktop-widgets/tab-widgets/TabDiveSite.h @@ -22,6 +22,7 @@ private slots: private: Ui::TabDiveSite ui; DiveSiteSortedModel model; + QVector selectedDiveSites(); void updateFilter(); void hideEvent(QHideEvent *) override; void showEvent(QShowEvent *) override; -- cgit v1.2.3-70-g09d2