mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Partially revert 3025e0630d
This commit did the "right" thing by implementing Qt mode semantics as intended, but for unknown reasons the profile is not properly cleared on close-file anymore. This code is so convoluted that there is not point in fighting it at the moment. Revert to remove-rows instead of reset-model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
065559c3d8
commit
36094e4a18
1 changed files with 11 additions and 9 deletions
|
@ -169,7 +169,8 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation,
|
||||||
|
|
||||||
void DivePlotDataModel::clear()
|
void DivePlotDataModel::clear()
|
||||||
{
|
{
|
||||||
beginResetModel();
|
if (rowCount() != 0) {
|
||||||
|
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
|
||||||
pInfo.nr = 0;
|
pInfo.nr = 0;
|
||||||
free(pInfo.entry);
|
free(pInfo.entry);
|
||||||
free(pInfo.pressures);
|
free(pInfo.pressures);
|
||||||
|
@ -177,7 +178,8 @@ void DivePlotDataModel::clear()
|
||||||
pInfo.pressures = nullptr;
|
pInfo.pressures = nullptr;
|
||||||
diveId = -1;
|
diveId = -1;
|
||||||
dcNr = -1;
|
dcNr = -1;
|
||||||
endResetModel();
|
endRemoveRows();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePlotDataModel::setDive(dive *d, const plot_info &info)
|
void DivePlotDataModel::setDive(dive *d, const plot_info &info)
|
||||||
|
|
Loading…
Reference in a new issue