diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-10-01 16:27:22 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-01 17:59:35 -0400 |
commit | d032373cafb75f853362ed6efde740f094b449f4 (patch) | |
tree | 8bfae259b06f18b41709a05fab7d62d34591d536 | |
parent | f1558b86dace61eddb29bb82e01970334c34a433 (diff) | |
download | subsurface-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>
-rw-r--r-- | qt-ui/locationinformation.cpp | 4 |
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)); } } |