summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2018-11-16 15:23:39 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-12-14 01:05:18 +0800
commit705e61b62c87842c8057e185f68d4d7a00cd17ec (patch)
treee878fb62df3b44c8c05f96bc27309badb33f0b26
parent201f0c8f89d6d7df96fd220ea2c0d0977c9b7f20 (diff)
downloadsubsurface-705e61b62c87842c8057e185f68d4d7a00cd17ec.tar.gz
Hide unimplemented components from search
Those fields are not ready yet, hide them. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r--desktop-widgets/filterwidget2.cpp6
-rw-r--r--desktop-widgets/filterwidget2.ui2
-rw-r--r--qt-models/filtermodels.cpp9
3 files changed, 16 insertions, 1 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp
index 473a4ad54..d120ffe4d 100644
--- a/desktop-widgets/filterwidget2.cpp
+++ b/desktop-widgets/filterwidget2.cpp
@@ -18,6 +18,12 @@ FilterWidget2::FilterWidget2(QWidget* parent)
ui->maxAirTemp->setValue(data.maxAirTemp);
ui->minWaterTemp->setValue(data.minWaterTemp);
ui->maxWaterTemp->setValue(data.maxWaterTemp);
+
+ // TODO: unhide this when we discover how to search for equipment.
+ ui->equipment->hide();
+ ui->labelEquipment->hide();
+ ui->invertFilter->hide();
+
ui->to->setDate(data.to.date());
connect(ui->maxRating, &StarWidget::valueChanged,
diff --git a/desktop-widgets/filterwidget2.ui b/desktop-widgets/filterwidget2.ui
index bf6d6a8ed..978dafc6e 100644
--- a/desktop-widgets/filterwidget2.ui
+++ b/desktop-widgets/filterwidget2.ui
@@ -141,7 +141,7 @@
<widget class="QDoubleSpinBox" name="maxWaterTemp"/>
</item>
<item row="10" column="0">
- <widget class="QLabel" name="label_10">
+ <widget class="QLabel" name="labelEquipment">
<property name="text">
<string>Equipment</string>
</property>
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 3cae58e80..25344b712 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -68,6 +68,12 @@ namespace {
}
return true;
}
+
+ // TODO: Finish this iimplementation.
+ bool hasEquipment(const QStringList& equipment, const struct dive *d)
+ {
+ return true;
+ }
}
MultiFilterSortModel *MultiFilterSortModel::instance()
@@ -129,6 +135,9 @@ bool MultiFilterSortModel::showDive(const struct dive *d) const
if (!hasLocation(filterData.location, d))
return false;
+ if (!hasEquipment(filterData.equipment, d))
+ return false;
+
return true;
}