mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Filter for logged/planned dives
Add filter for dives having a planned dive computer or a logged dive computer. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
c349692d98
commit
123f3ef7ec
8 changed files with 208 additions and 137 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
- Allow to filter for logged/planned dives
|
||||||
- Core, Windows: fix a bug related to non-ASCII characters in user names
|
- Core, Windows: fix a bug related to non-ASCII characters in user names
|
||||||
- Shearwater import: add suppport for importing Shearwater Cloud logs
|
- Shearwater import: add suppport for importing Shearwater Cloud logs
|
||||||
- Core, Mobile: all controller states other than powered off are valid [#1903]
|
- Core, Mobile: all controller states other than powered off are valid [#1903]
|
||||||
|
|
12
core/dive.c
12
core/dive.c
|
@ -3361,6 +3361,18 @@ bool is_dc_planner(const struct divecomputer *dc) {
|
||||||
return same_string(dc->model, "planned dive");
|
return same_string(dc->model, "planned dive");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Does this dive have a dive computer for which is_dc_planner has value planned
|
||||||
|
bool has_planned(const struct dive *dive, bool planned) {
|
||||||
|
const struct divecomputer *dc = &dive->dc;
|
||||||
|
|
||||||
|
while (dc) {
|
||||||
|
if (is_dc_planner(&dive->dc) == planned)
|
||||||
|
return true;
|
||||||
|
dc = dc->next;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Merging two dives can be subtle, because there's two different ways
|
* Merging two dives can be subtle, because there's two different ways
|
||||||
* of merging:
|
* of merging:
|
||||||
|
|
|
@ -653,6 +653,8 @@ extern void vpmb_start_gradient(struct deco_state *ds);
|
||||||
extern void vpmb_next_gradient(struct deco_state *ds, double deco_time, double surface_pressure);
|
extern void vpmb_next_gradient(struct deco_state *ds, double deco_time, double surface_pressure);
|
||||||
extern double tissue_tolerance_calc(struct deco_state *ds, const struct dive *dive, double pressure);
|
extern double tissue_tolerance_calc(struct deco_state *ds, const struct dive *dive, double pressure);
|
||||||
extern bool is_dc_planner(const struct divecomputer *dc);
|
extern bool is_dc_planner(const struct divecomputer *dc);
|
||||||
|
extern bool has_planned(const struct dive *dive, bool planned);
|
||||||
|
|
||||||
|
|
||||||
/* this should be converted to use our types */
|
/* this should be converted to use our types */
|
||||||
struct divedatapoint {
|
struct divedatapoint {
|
||||||
|
|
|
@ -18,6 +18,8 @@ FilterWidget2::FilterWidget2(QWidget* parent)
|
||||||
ui->maxAirTemp->setValue(data.maxAirTemp);
|
ui->maxAirTemp->setValue(data.maxAirTemp);
|
||||||
ui->minWaterTemp->setValue(data.minWaterTemp);
|
ui->minWaterTemp->setValue(data.minWaterTemp);
|
||||||
ui->maxWaterTemp->setValue(data.maxWaterTemp);
|
ui->maxWaterTemp->setValue(data.maxWaterTemp);
|
||||||
|
ui->planned->setChecked(data.logged);
|
||||||
|
ui->planned->setChecked(data.planned);
|
||||||
|
|
||||||
// TODO: unhide this when we discover how to search for equipment.
|
// TODO: unhide this when we discover how to search for equipment.
|
||||||
ui->equipment->hide();
|
ui->equipment->hide();
|
||||||
|
@ -64,6 +66,11 @@ FilterWidget2::FilterWidget2(QWidget* parent)
|
||||||
|
|
||||||
connect(ui->location, &QLineEdit::textChanged,
|
connect(ui->location, &QLineEdit::textChanged,
|
||||||
this, &FilterWidget2::updateFilter);
|
this, &FilterWidget2::updateFilter);
|
||||||
|
|
||||||
|
connect(ui->logged, SIGNAL(stateChanged(int)), this, SLOT(updateLogged(int)));
|
||||||
|
|
||||||
|
connect(ui->planned, SIGNAL(stateChanged(int)), this, SLOT(updatePlanned(int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilterWidget2::updateFilter()
|
void FilterWidget2::updateFilter()
|
||||||
|
@ -86,11 +93,26 @@ void FilterWidget2::updateFilter()
|
||||||
data.location = ui->location->text().split(",", QString::SkipEmptyParts);
|
data.location = ui->location->text().split(",", QString::SkipEmptyParts);
|
||||||
data.equipment = ui->equipment->text().split(",", QString::SkipEmptyParts);
|
data.equipment = ui->equipment->text().split(",", QString::SkipEmptyParts);
|
||||||
data.invertFilter = ui->invertFilter->isChecked();
|
data.invertFilter = ui->invertFilter->isChecked();
|
||||||
|
data.logged = ui->logged->isChecked();
|
||||||
|
data.planned = ui->planned->isChecked();
|
||||||
|
|
||||||
filterData = data;
|
filterData = data;
|
||||||
emit filterDataChanged(data);
|
emit filterDataChanged(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FilterWidget2::updateLogged(int value) {
|
||||||
|
if (value == Qt::Unchecked)
|
||||||
|
ui->planned->setChecked(true);
|
||||||
|
updateFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
void FilterWidget2::updatePlanned(int value) {
|
||||||
|
if (value == Qt::Unchecked)
|
||||||
|
ui->logged->setChecked(true);
|
||||||
|
updateFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FilterWidget2::showEvent(QShowEvent *event)
|
void FilterWidget2::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
|
|
|
@ -27,6 +27,12 @@ protected:
|
||||||
signals:
|
signals:
|
||||||
void filterDataChanged(const FilterData& data);
|
void filterDataChanged(const FilterData& data);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void updatePlanned(int value);
|
||||||
|
void updateLogged(int value);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::FilterWidget2> ui;
|
std::unique_ptr<Ui::FilterWidget2> ui;
|
||||||
FilterData filterData;
|
FilterData filterData;
|
||||||
|
|
|
@ -7,77 +7,24 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>510</width>
|
<width>510</width>
|
||||||
<height>320</height>
|
<height>349</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="3" column="1">
|
<item row="8" column="1" colspan="4">
|
||||||
<widget class="QLabel" name="label_12">
|
<widget class="QLineEdit" name="tags"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Min</string>
|
<string>Min</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="4">
|
<item row="9" column="0">
|
||||||
<widget class="StarWidget" name="maxVisibility" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::TabFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="minWaterTemp"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="StarWidget" name="minVisibility" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::TabFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="text">
|
|
||||||
<string>Tags</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string> Rating</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="StarWidget" name="minRating" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::TabFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="0">
|
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>People</string>
|
<string>People</string>
|
||||||
|
@ -91,17 +38,24 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Min</string>
|
<string> Rating</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1" colspan="4">
|
<item row="8" column="0">
|
||||||
<widget class="QLineEdit" name="tags"/>
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Tags</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="1" colspan="4">
|
<item row="3" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="minWaterTemp"/>
|
||||||
|
</item>
|
||||||
|
<item row="12" column="1" colspan="4">
|
||||||
<widget class="QCheckBox" name="invertFilter">
|
<widget class="QCheckBox" name="invertFilter">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Display dives that will not match the search, only applies to tags, people, location and equipment</string>
|
<string>Display dives that will not match the search, only applies to tags, people, location and equipment</string>
|
||||||
|
@ -118,58 +72,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1" colspan="4">
|
<item row="3" column="1">
|
||||||
<widget class="QDateTimeEdit" name="from"/>
|
<widget class="QLabel" name="label_12">
|
||||||
</item>
|
|
||||||
<item row="8" column="1" colspan="4">
|
|
||||||
<widget class="QLineEdit" name="people"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="4">
|
|
||||||
<widget class="StarWidget" name="maxRating" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::TabFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="4">
|
|
||||||
<widget class="QDoubleSpinBox" name="maxWaterTemp"/>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="0">
|
|
||||||
<widget class="QLabel" name="labelEquipment">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Equipment</string>
|
<string>Min</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QLabel" name="label_15">
|
|
||||||
<property name="text">
|
|
||||||
<string>Max</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0">
|
|
||||||
<widget class="QLabel" name="label_9">
|
|
||||||
<property name="text">
|
|
||||||
<string>Location</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="1" colspan="4">
|
|
||||||
<widget class="QLineEdit" name="location"/>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1" colspan="4">
|
|
||||||
<widget class="QDateTimeEdit" name="to"/>
|
|
||||||
</item>
|
|
||||||
<item row="10" column="1" colspan="4">
|
|
||||||
<widget class="QLineEdit" name="equipment"/>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -184,6 +93,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="label_17">
|
||||||
|
<property name="text">
|
||||||
|
<string>Min</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="4">
|
||||||
|
<widget class="QDoubleSpinBox" name="maxWaterTemp"/>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -191,13 +110,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_11">
|
|
||||||
<property name="text">
|
|
||||||
<string>Water Temp</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="label_14">
|
<widget class="QLabel" name="label_14">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -205,33 +117,141 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="1" column="3">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_15">
|
||||||
<property name="text">
|
|
||||||
<string>Air Temp</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLabel" name="label_17">
|
|
||||||
<property name="text">
|
|
||||||
<string>Min</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="3">
|
|
||||||
<widget class="QLabel" name="label_18">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max</string>
|
<string>Max</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="1" colspan="4">
|
||||||
|
<widget class="QLineEdit" name="location"/>
|
||||||
|
</item>
|
||||||
|
<item row="11" column="0">
|
||||||
|
<widget class="QLabel" name="labelEquipment">
|
||||||
|
<property name="text">
|
||||||
|
<string>Equipment</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QDoubleSpinBox" name="minAirTemp"/>
|
<widget class="QDoubleSpinBox" name="minAirTemp"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="4">
|
<item row="4" column="4">
|
||||||
<widget class="QDoubleSpinBox" name="maxAirTemp"/>
|
<widget class="QDoubleSpinBox" name="maxAirTemp"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="11" column="1" colspan="4">
|
||||||
|
<widget class="QLineEdit" name="equipment"/>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string>Water Temp</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="1" colspan="4">
|
||||||
|
<widget class="QLineEdit" name="people"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="3">
|
||||||
|
<widget class="QLabel" name="label_18">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1" colspan="4">
|
||||||
|
<widget class="QDateTimeEdit" name="from"/>
|
||||||
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>Location</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1" colspan="4">
|
||||||
|
<widget class="QDateTimeEdit" name="to"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Air Temp</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="4">
|
||||||
|
<widget class="StarWidget" name="maxVisibility" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::TabFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="StarWidget" name="minVisibility" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::TabFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="StarWidget" name="minRating" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::TabFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="StarWidget" name="maxRating" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::TabFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
|
<widget class="QCheckBox" name="logged">
|
||||||
|
<property name="text">
|
||||||
|
<string>Logged</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="2">
|
||||||
|
<widget class="QCheckBox" name="planned">
|
||||||
|
<property name="text">
|
||||||
|
<string>Planned</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|
|
@ -138,6 +138,12 @@ bool MultiFilterSortModel::showDive(const struct dive *d) const
|
||||||
if (!hasEquipment(filterData.equipment, d))
|
if (!hasEquipment(filterData.equipment, d))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Planned/Logged
|
||||||
|
if (!filterData.logged && !has_planned(d, true))
|
||||||
|
return false;
|
||||||
|
if (!filterData.planned && !has_planned(d, false))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ struct FilterData {
|
||||||
QStringList people;
|
QStringList people;
|
||||||
QStringList location;
|
QStringList location;
|
||||||
QStringList equipment;
|
QStringList equipment;
|
||||||
|
bool logged = true;
|
||||||
|
bool planned = true;
|
||||||
bool invertFilter;
|
bool invertFilter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue