From d032373cafb75f853362ed6efde740f094b449f4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 1 Oct 2015 16:27:22 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui') 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)); } } -- cgit v1.2.3-70-g09d2