mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site: display proper text for the two special options
The dive-site line edit box features two special entries for adding new dive sites. These should display different texts depending on whether the current dive has a dive site or not. The current check is wrong, because it used displayed_dive, but since the last set of undo-changes, this might not be filled out correctly anymore. Instead the code should check the actual current dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
606c3a0245
commit
826cc97921
1 changed files with 2 additions and 1 deletions
|
@ -299,12 +299,13 @@ QVariant DiveLocationModel::data(const QModelIndex &index, int role) const
|
|||
case Qt::DisplayRole:
|
||||
return new_ds_value[index.row()];
|
||||
case Qt::ToolTipRole:
|
||||
return displayed_dive.dive_site ?
|
||||
return current_dive && current_dive->dive_site ?
|
||||
tr("Create a new dive site, copying relevant information from the current dive.") :
|
||||
tr("Create a new dive site with this name");
|
||||
case Qt::DecorationRole:
|
||||
return plusIcon;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// The dive sites are -2 because of the first two items.
|
||||
|
|
Loading…
Add table
Reference in a new issue