From 64453893a0d8f88f4c70b5606d133b1acc68d10b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 25 Sep 2015 14:51:10 -0300 Subject: Do not set text on the Location LineEdit Since the location is only true with a valid uuid, set the uuid on it, it will search for a valid name and set there. this fixes a few inconsistencies handling the locations. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'qt-ui/locationinformation.cpp') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 29ce1548d..90d7dae6c 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -538,6 +538,18 @@ void DiveLocationLineEdit::fixPopupPosition() } } +void DiveLocationLineEdit::setCurrentDiveSiteUuid(uint32_t uuid) +{ + currUuid = uuid; + if(uuid == 0) { + currType = NO_DIVE_SITE; + } + struct dive_site *ds = get_dive_site_by_uuid(uuid); + if(!ds) + clear(); + setText(ds->name); +} + void DiveLocationLineEdit::showPopup() { fixPopupPosition(); -- cgit v1.2.3-70-g09d2