mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: remove select_dc() function
The only caller misused this function to get access to the current divecomputer. Remove it, since selection of the current divecomputer is handled by the MainWindow. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e9aaab3c19
commit
04241ebb9d
3 changed files with 3 additions and 16 deletions
|
@ -26,8 +26,6 @@ struct plot_info {
|
||||||
struct plot_pressure_data *pressures; /* cylinders.nr blocks of nr entries. */
|
struct plot_pressure_data *pressures; /* cylinders.nr blocks of nr entries. */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct divecomputer *select_dc(struct dive *);
|
|
||||||
|
|
||||||
extern int is_default_dive_computer_device(const char *);
|
extern int is_default_dive_computer_device(const char *);
|
||||||
|
|
||||||
typedef void (*device_callback_t)(const char *name, void *userdata);
|
typedef void (*device_callback_t)(const char *name, void *userdata);
|
||||||
|
|
|
@ -1311,18 +1311,6 @@ void create_plot_info_new(const struct dive *dive, const struct divecomputer *dc
|
||||||
analyze_plot_info(pi);
|
analyze_plot_info(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct divecomputer *select_dc(struct dive *dive)
|
|
||||||
{
|
|
||||||
unsigned int max = number_of_computers(dive);
|
|
||||||
unsigned int i = dc_number;
|
|
||||||
|
|
||||||
/* Reset 'dc_number' if we've switched dives and it is now out of range */
|
|
||||||
if (i >= max)
|
|
||||||
dc_number = i = 0;
|
|
||||||
|
|
||||||
return get_dive_dc(dive, i);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void plot_string(const struct dive *d, const struct plot_info *pi, int idx, struct membuffer *b)
|
static void plot_string(const struct dive *d, const struct plot_info *pi, int idx, struct membuffer *b)
|
||||||
{
|
{
|
||||||
int pressurevalue, mod, ead, end, eadd;
|
int pressurevalue, mod, ead, end, eadd;
|
||||||
|
|
|
@ -116,8 +116,9 @@ void TabDiveInformation::updateProfile()
|
||||||
volume_t *gases = get_gas_used(current_dive);
|
volume_t *gases = get_gas_used(current_dive);
|
||||||
QString volumes;
|
QString volumes;
|
||||||
std::vector<int> mean(current_dive->cylinders.nr), duration(current_dive->cylinders.nr);
|
std::vector<int> mean(current_dive->cylinders.nr), duration(current_dive->cylinders.nr);
|
||||||
if (current_dive->cylinders.nr >= 0)
|
struct divecomputer *currentdc = get_dive_dc(current_dive, dc_number);
|
||||||
per_cylinder_mean_depth(current_dive, select_dc(current_dive), mean.data(), duration.data());
|
if (currentdc && current_dive->cylinders.nr >= 0)
|
||||||
|
per_cylinder_mean_depth(current_dive, currentdc, mean.data(), duration.data());
|
||||||
volume_t sac;
|
volume_t sac;
|
||||||
QString gaslist, SACs, separator;
|
QString gaslist, SACs, separator;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue