mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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)
|
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);
|
currentDs = get_dive_site_by_uuid(uuid);
|
||||||
if(!currentDs)
|
if(!currentDs)
|
||||||
return;
|
return;
|
||||||
|
@ -164,11 +169,8 @@ void LocationInformationWidget::rejectChanges()
|
||||||
|
|
||||||
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
void LocationInformationWidget::showEvent(QShowEvent *ev)
|
||||||
{
|
{
|
||||||
LocationInformationModel *m = (LocationInformationModel*) ui.currentLocation->model();
|
|
||||||
ui.diveSiteMessage->setCloseButtonVisible(false);
|
ui.diveSiteMessage->setCloseButtonVisible(false);
|
||||||
m->update();
|
|
||||||
QGroupBox::showEvent(ev);
|
QGroupBox::showEvent(ev);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationInformationWidget::markChangedWidget(QWidget *w)
|
void LocationInformationWidget::markChangedWidget(QWidget *w)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue