mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
Only repopulate model when needed.
The old way we set the location and *then* updated the model, so the very first location that we tried to show was empty. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b7ec57bdef
commit
785051c9dd
1 changed files with 5 additions and 3 deletions
|
@ -82,6 +82,11 @@ void LocationInformationWidget::setCurrentDiveSite(int dive_nr)
|
|||
|
||||
void LocationInformationWidget::setLocationId(uint32_t uuid)
|
||||
{
|
||||
LocationInformationModel *m = (LocationInformationModel*) ui.currentLocation->model();
|
||||
if (m->rowCount() == 0) {
|
||||
m->update();
|
||||
}
|
||||
|
||||
currentDs = get_dive_site_by_uuid(uuid);
|
||||
if(!currentDs)
|
||||
return;
|
||||
|
@ -164,11 +169,8 @@ void LocationInformationWidget::rejectChanges()
|
|||
|
||||
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
||||
{
|
||||
LocationInformationModel *m = (LocationInformationModel*) ui.currentLocation->model();
|
||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||
m->update();
|
||||
QGroupBox::showEvent(ev);
|
||||
|
||||
}
|
||||
|
||||
void LocationInformationWidget::markChangedWidget(QWidget *w)
|
||||
|
|
Loading…
Add table
Reference in a new issue