aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-23 16:19:58 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 14:15:49 -0700
commitd95856d3b272671fe9db008605ea84b27195f46b (patch)
treeec3e10b334624fa3682389ee4595140764d174be
parentcc6967b53c0ac6b0a3b892454413247f0e365b72 (diff)
downloadsubsurface-d95856d3b272671fe9db008605ea84b27195f46b.tar.gz
Select an index if no index is selected
Defaults to first row. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/locationinformation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 56ef2d7f3..8e08a60be 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -522,6 +522,9 @@ void DiveLocationLineEdit::fixPopupPosition()
}
view->setGeometry(pos.x(), pos.y(), w, h);
+ if(!view->currentIndex().isValid()) {
+ view->setCurrentIndex(view->model()->index(0,1));
+ }
}
void DiveLocationLineEdit::showPopup()
@@ -530,7 +533,6 @@ void DiveLocationLineEdit::showPopup()
if (!view->isVisible()) {
setTemporaryDiveSiteName(text());
proxy->invalidate();
- view->setCurrentIndex(view->model()->index(0,1));
view->show();
}
}