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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-09-25 14:51:10 -03:00 committed by Dirk Hohndel
parent 94d05d1cb6
commit 64453893a0
3 changed files with 21 additions and 6 deletions

View file

@ -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();