summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-10-05 18:01:28 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-06 00:01:30 +0100
commit437469e8ff349599cfdac243ad2d8a59ab6da6a2 (patch)
tree2b97932193a146af0366c0f04da937aa56f2abac /qt-ui
parent3c2965b15107e49aa0ff686987390bc896ee3407 (diff)
downloadsubsurface-437469e8ff349599cfdac243ad2d8a59ab6da6a2.tar.gz
Do not incorrectly use the UUID as the dive name
for some reason sometimes activating the dive via tab or enter gave us the wrong column, so simply select the right one. 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.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 4c11326f3..5807266fd 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -447,11 +447,15 @@ void DiveLocationLineEdit::focusOutEvent(QFocusEvent *ev)
void DiveLocationLineEdit::itemActivated(const QModelIndex &index)
{
+ QModelIndex idx = index;
+ if (index.column() == DiveLocationModel::UUID)
+ idx = index.model()->index(index.row(), DiveLocationModel::NAME);
+
QModelIndex uuidIndex = index.model()->index(index.row(), DiveLocationModel::UUID);
uint32_t uuid = uuidIndex.data().toInt();
currType = uuid == 1 ? NEW_DIVE_SITE : EXISTING_DIVE_SITE;
currUuid = uuid;
- setText(index.data().toString());
+ setText(idx.data().toString());
if (currUuid == NEW_DIVE_SITE)
qDebug() << "Setting a New dive site";
else