diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-09-22 17:20:55 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-23 14:15:23 -0700 |
commit | 4b8eec6c580dd33278bd6487a88575ad39b40378 (patch) | |
tree | 8c9cb810067f961af0e6bd3022938e68aab1bece | |
parent | 80b42bd28bc9d98dc9f645a4f6e56c224ee855b2 (diff) | |
download | subsurface-4b8eec6c580dd33278bd6487a88575ad39b40378.tar.gz |
Fix new/existing dive site choices
Only set the currType and currUuid if text changed.
This is needed because if you hit key_down it would
set NEW_DIVE_SITE because a keypress on the lineedit was
due.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/locationinformation.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 206b6eccf..bb07303dd 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -489,6 +489,10 @@ void DiveLocationLineEdit::itemActivated(const QModelIndex& index) currType = uuid == 1 ? NEW_DIVE_SITE : EXISTING_DIVE_SITE; currUuid = uuid; setText(index.data().toString()); + if(currUuid == NEW_DIVE_SITE) + qDebug() << "Setting a New dive site"; + else + qDebug() << "Setting a Existing dive site"; } void DiveLocationLineEdit::refreshDiveSiteCache() @@ -533,6 +537,11 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev) ev->key() != Qt::Key_Right && ev->key() != Qt::Key_Escape && ev->key() != Qt::Key_Return ) { + + if(ev->key() != Qt::Key_Up && ev->key() != Qt::Key_Down) { + currType = NEW_DIVE_SITE; + currUuid = RECENTLY_ADDED_DIVESITE; + } showPopup(); } else if (ev->key() == Qt::Key_Escape) { view->hide(); |