mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Correctly trigger update of cylinder table trash icons in planner
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
2b5a2352ea
commit
8834fc0443
3 changed files with 9 additions and 0 deletions
|
@ -600,6 +600,11 @@ void CylindersModel::updateDecoDepths(pressure_t olddecopo2)
|
|||
emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1));
|
||||
}
|
||||
|
||||
void CylindersModel::updateTrashIcon()
|
||||
{
|
||||
emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, 0));
|
||||
}
|
||||
|
||||
bool CylindersModel::updateBestMixes()
|
||||
{
|
||||
// Check if any of the cylinders are best mixes, update if needed
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
void updateDive();
|
||||
void copyFromDive(struct dive *d);
|
||||
void updateDecoDepths(pressure_t olddecopo2);
|
||||
void updateTrashIcon();
|
||||
cylinder_t *cylinderAt(const QModelIndex &index);
|
||||
bool changed;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
|
|
|
@ -24,6 +24,7 @@ void DivePlannerPointsModel::removeSelectedPoints(const QVector<int> &rows)
|
|||
divepoints.remove(v2[i]);
|
||||
}
|
||||
endRemoveRows();
|
||||
CylindersModel::instance()->updateTrashIcon();
|
||||
}
|
||||
|
||||
void DivePlannerPointsModel::createSimpleDive()
|
||||
|
@ -314,6 +315,7 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v
|
|||
case GAS:
|
||||
if (value.toInt() >= 0 && value.toInt() < MAX_CYLINDERS)
|
||||
p.cylinderid = value.toInt();
|
||||
CylindersModel::instance()->updateTrashIcon();
|
||||
break;
|
||||
}
|
||||
editStop(index.row(), p);
|
||||
|
@ -732,6 +734,7 @@ void DivePlannerPointsModel::remove(const QModelIndex &index)
|
|||
divepoints.remove(index.row());
|
||||
}
|
||||
endRemoveRows();
|
||||
CylindersModel::instance()->updateTrashIcon();
|
||||
}
|
||||
|
||||
struct diveplan &DivePlannerPointsModel::getDiveplan()
|
||||
|
|
Loading…
Reference in a new issue