aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets/TabDiveEquipment.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-01-30 20:12:11 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-11 20:37:09 -0800
commit6622f42aab937e72cc11cb5512012394aa687767 (patch)
tree42302a42594b78b99111e98c6fd9325a0b9c5959 /desktop-widgets/tab-widgets/TabDiveEquipment.h
parentb37c261c95761cb5762e91b5d43277d2b0181678 (diff)
downloadsubsurface-6622f42aab937e72cc11cb5512012394aa687767.tar.gz
Cylinders: Add CylindersModelFiltered
When the show_unused_cylinders flag is not set, the cylinder tables in the equipment tab and the planner should not show unused cylinders. However, the code in CylindersModel is fundamentally broken if the unused cylinders are not at the end of the list: The correct number of cylinders is shown, but not the correct cylinders. Therefore, add a higher-level CylindersModelFiltered model on top of CylindersModel that does the actual filtering. Some calls are routed through to the base model (notably those that take indexes, as these have to be mapped), for some calls the caller has to get access to the source model first. We might want to adjust this. For filtering, reuse the already existing show_cylinder function and export it via CylindersModel. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets/TabDiveEquipment.h')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveEquipment.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.h b/desktop-widgets/tab-widgets/TabDiveEquipment.h
index 1edc20cef..28e6235d1 100644
--- a/desktop-widgets/tab-widgets/TabDiveEquipment.h
+++ b/desktop-widgets/tab-widgets/TabDiveEquipment.h
@@ -12,7 +12,7 @@ namespace Ui {
};
class WeightModel;
-class CylindersModel;
+class CylindersModelFiltered;
class TabDiveEquipment : public TabBase {
Q_OBJECT
@@ -38,7 +38,7 @@ private slots:
private:
Ui::TabDiveEquipment ui;
SuitCompletionModel suitModel;
- CylindersModel *cylindersModel;
+ CylindersModelFiltered *cylindersModel;
WeightModel *weightModel;
};