summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-06-30 23:18:12 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-07-04 10:41:09 +0900
commit09163c1ee7dc469d44cdf4631b51579e607be6f2 (patch)
treebd13f538ff59eb47ca96d89c9caac4d2f4d55b60 /desktop-widgets/locationinformation.cpp
parent02e94de062dc2c776ee37e8f642f0ec0ae8ad9e7 (diff)
downloadsubsurface-09163c1ee7dc469d44cdf4631b51579e607be6f2.tar.gz
Cleanup: remove DiveLocationLineEdit::currType
Apparently this field was never used...? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r--desktop-widgets/locationinformation.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index 1c8c79aef..4dce409db 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -364,7 +364,6 @@ DiveLocationLineEdit::DiveLocationLineEdit(QWidget *parent) : QLineEdit(parent),
proxy(new DiveLocationFilterProxyModel()),
model(new DiveLocationModel()),
view(new DiveLocationListView()),
- currType(NO_DIVE_SITE),
currDs(nullptr)
{
proxy->setSourceModel(model);
@@ -443,13 +442,8 @@ void DiveLocationLineEdit::itemActivated(const QModelIndex &index)
idx = index.model()->index(index.row(), LocationInformationModel::NAME);
dive_site *ds = index.model()->index(index.row(), LocationInformationModel::DIVESITE).data().value<dive_site *>();
- currType = ds == RECENTLY_ADDED_DIVESITE ? NEW_DIVE_SITE : EXISTING_DIVE_SITE;
currDs = ds;
setText(idx.data().toString());
- if (currType == NEW_DIVE_SITE)
- qDebug() << "Setting a New dive site";
- else
- qDebug() << "Setting a Existing dive site";
if (view->isVisible())
view->hide();
emit diveSiteSelected();
@@ -509,12 +503,10 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
ev->key() != Qt::Key_Escape &&
ev->key() != Qt::Key_Return) {
- if (ev->key() != Qt::Key_Up && ev->key() != Qt::Key_Down) {
- currType = NEW_DIVE_SITE;
+ if (ev->key() != Qt::Key_Up && ev->key() != Qt::Key_Down)
currDs = RECENTLY_ADDED_DIVESITE;
- } else {
+ else
showPopup();
- }
} else if (ev->key() == Qt::Key_Escape) {
view->hide();
}
@@ -561,12 +553,10 @@ void DiveLocationLineEdit::setCurrentDiveSite(struct dive *d)
{
struct dive_site *ds = get_dive_site_for_dive(d);
currDs = ds;
- if (!currDs) {
- currType = NO_DIVE_SITE;
+ if (!currDs)
clear();
- } else {
+ else
setText(ds->name);
- }
location_t currentLocation = d ? dive_get_gps_location(d) : location_t{0, 0};
proxy->setCurrentLocation(currentLocation);
@@ -593,11 +583,6 @@ void DiveLocationLineEdit::showAllSites()
}
}
-DiveLocationLineEdit::DiveSiteType DiveLocationLineEdit::currDiveSiteType() const
-{
- return currType;
-}
-
struct dive_site *DiveLocationLineEdit::currDiveSite() const
{
// If there is no text, this corresponds to the empty dive site