mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
80b42bd28b
commit
4b8eec6c58
1 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue