mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: remove global model instances
The only user of the DivePlannerPointsModel and the GasSelectionModel is the planner. Let's keep these models there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3dd09b31e3
commit
b5682369f8
6 changed files with 33 additions and 29 deletions
|
@ -2,6 +2,7 @@
|
|||
#ifndef DIVEPLANNER_H
|
||||
#define DIVEPLANNER_H
|
||||
|
||||
#include <memory>
|
||||
#include <QAbstractTableModel>
|
||||
#include <QAbstractButton>
|
||||
#include <QDateTime>
|
||||
|
@ -9,6 +10,9 @@
|
|||
class QListView;
|
||||
class QModelIndex;
|
||||
class DivePlannerPointsModel;
|
||||
class GasSelectionModel;
|
||||
class DiveTypeSelectionModel;
|
||||
class PlannerWidgets;
|
||||
struct dive;
|
||||
|
||||
#include "ui_diveplanner.h"
|
||||
|
@ -16,7 +20,8 @@ struct dive;
|
|||
class DivePlannerWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DivePlannerWidget(QWidget *parent = 0);
|
||||
explicit DivePlannerWidget(PlannerWidgets *parent);
|
||||
~DivePlannerWidget();
|
||||
void setReplanButton(bool replan);
|
||||
public
|
||||
slots:
|
||||
|
@ -76,6 +81,7 @@ class PlannerWidgets : public QObject {
|
|||
Q_OBJECT
|
||||
public:
|
||||
PlannerWidgets();
|
||||
~PlannerWidgets();
|
||||
void planDive(dive *currentDive);
|
||||
void replanDive(int currentDC);
|
||||
public
|
||||
|
@ -85,6 +91,8 @@ public:
|
|||
DivePlannerWidget plannerWidget;
|
||||
PlannerSettingsWidget plannerSettingsWidget;
|
||||
PlannerDetails plannerDetails;
|
||||
std::unique_ptr<GasSelectionModel> gasModel;
|
||||
std::unique_ptr<DiveTypeSelectionModel> diveTypeModel;
|
||||
};
|
||||
|
||||
#endif // DIVEPLANNER_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue