diff options
-rw-r--r-- | core/dive.c | 12 | ||||
-rw-r--r-- | core/dive.h | 2 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 8 |
3 files changed, 5 insertions, 17 deletions
diff --git a/core/dive.c b/core/dive.c index 5bb406f08..0aa7a4324 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3311,18 +3311,6 @@ bool time_during_dive_with_offset(const struct dive *dive, timestamp_t when, tim return start - offset <= when && when <= end + offset; } -timestamp_t get_times() -{ - int i; - struct dive *dive; - - for_each_dive (i, dive) { - if (dive->selected) - break; - } - return dive->when; -} - /* this sets a usually unused copy of the preferences with the units * that were active the last time the dive list was saved to git storage * (this isn't used in XML files); storing the unit preferences in the diff --git a/core/dive.h b/core/dive.h index 523d648bb..968c221ec 100644 --- a/core/dive.h +++ b/core/dive.h @@ -260,8 +260,6 @@ extern void subsurface_console_init(void); extern void subsurface_console_exit(void); extern bool subsurface_user_is_root(void); -extern timestamp_t get_times(); - extern struct dive *alloc_dive(void); extern void free_dive(struct dive *); extern void free_dive_dcs(struct divecomputer *dc); diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index 6eaab2eef..943da56c3 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -193,9 +193,11 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button) } ui.timeEdit->setTime(QTime(0, 0, 0, 0)); - when = get_times(); //get time of first selected dive - ui.currentTime->setText(get_dive_date_string(when)); - ui.shiftedTime->setText(get_dive_date_string(when)); + dive *d = first_selected_dive(); + if (d) { + ui.currentTime->setText(get_dive_date_string(d->when)); + ui.shiftedTime->setText(get_dive_date_string(d->when)); + } } void ShiftTimesDialog::changeTime() |