mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move remove_weightsystem() to weightsystem_table
Feel natural in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b5a4e7eb0b
commit
4cb3db2548
3 changed files with 4 additions and 4 deletions
|
@ -1018,7 +1018,7 @@ void RemoveWeight::undo()
|
||||||
void RemoveWeight::redo()
|
void RemoveWeight::redo()
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < dives.size(); ++i) {
|
for (size_t i = 0; i < dives.size(); ++i) {
|
||||||
remove_weightsystem(dives[i], indices[i]);
|
dives[i]->weightsystems.remove(indices[i]);
|
||||||
emit diveListNotifier.weightRemoved(dives[i], indices[i]);
|
emit diveListNotifier.weightRemoved(dives[i], indices[i]);
|
||||||
dives[i]->invalidate_cache(); // Ensure that dive is written in git_save()
|
dives[i]->invalidate_cache(); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,9 +307,9 @@ void remove_cylinder(struct dive *dive, int idx)
|
||||||
dive->cylinders.erase(dive->cylinders.begin() + idx);
|
dive->cylinders.erase(dive->cylinders.begin() + idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove_weightsystem(struct dive *dive, int idx)
|
void weightsystem_table::remove(int idx)
|
||||||
{
|
{
|
||||||
dive->weightsystems.erase(dive->weightsystems.begin() + idx);
|
erase(begin() + idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void weightsystem_table::add(int idx, weightsystem_t ws)
|
void weightsystem_table::add(int idx, weightsystem_t ws)
|
||||||
|
|
|
@ -71,12 +71,12 @@ struct weightsystem_t
|
||||||
struct weightsystem_table : public std::vector<weightsystem_t> {
|
struct weightsystem_table : public std::vector<weightsystem_t> {
|
||||||
void add(int idx, weightsystem_t ws);
|
void add(int idx, weightsystem_t ws);
|
||||||
void set(int idx, weightsystem_t ws);
|
void set(int idx, weightsystem_t ws);
|
||||||
|
void remove(int idx);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern enum cylinderuse cylinderuse_from_text(const char *text);
|
extern enum cylinderuse cylinderuse_from_text(const char *text);
|
||||||
extern void copy_cylinder_types(const struct dive *s, struct dive *d);
|
extern void copy_cylinder_types(const struct dive *s, struct dive *d);
|
||||||
extern void remove_cylinder(struct dive *dive, int idx);
|
extern void remove_cylinder(struct dive *dive, int idx);
|
||||||
extern void remove_weightsystem(struct dive *dive, int idx);
|
|
||||||
extern void reset_cylinders(struct dive *dive, bool track_gas);
|
extern void reset_cylinders(struct dive *dive, bool track_gas);
|
||||||
extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */
|
extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */
|
||||||
extern int find_best_gasmix_match(struct gasmix mix, const struct cylinder_table &cylinders);
|
extern int find_best_gasmix_match(struct gasmix mix, const struct cylinder_table &cylinders);
|
||||||
|
|
Loading…
Add table
Reference in a new issue