aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-10-01 16:27:22 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-01 17:59:35 -0400
commitd032373cafb75f853362ed6efde740f094b449f4 (patch)
tree8bfae259b06f18b41709a05fab7d62d34591d536 /qt-ui
parentf1558b86dace61eddb29bb82e01970334c34a433 (diff)
downloadsubsurface-d032373cafb75f853362ed6efde740f094b449f4.tar.gz
Fix selecting invalid dive site
This patch fixes an invalid dive site selection when you where typing the name of a dive site for your current dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationinformation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 0d3d66231..c03b0e869 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -545,8 +545,8 @@ void DiveLocationLineEdit::fixPopupPosition()
}
view->setGeometry(pos.x(), pos.y(), w, h);
- if (!view->currentIndex().isValid()) {
- view->setCurrentIndex(view->model()->index(0, 1));
+ if (!view->currentIndex().isValid() && view->model()->rowCount()) {
+ view->setCurrentIndex(view->model()->index(0, 0));
}
}