diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 13 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 10 |
2 files changed, 3 insertions, 20 deletions
diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index cf4b9b0ae..fb4d3750b 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -222,17 +222,8 @@ void ShiftTimesDialog::buttonClicked(QAbstractButton *button) amount = ui.timeEdit->time().hour() * 3600 + ui.timeEdit->time().minute() * 60; if (ui.backwards->isChecked()) amount *= -1; - if (amount != 0) { - // DANGER, DANGER - this could get our dive_table unsorted... - int i; - struct dive *d; - QVector<dive *> affectedDives; - for_each_dive (i, d) { - if (d->selected) - affectedDives.append(d); - } - Command::shiftTime(affectedDives, amount); - } + if (amount != 0) + Command::shiftTime(getDiveSelection(), amount); } } diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index b17b80633..85d64c66d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -677,18 +677,10 @@ void MainTab::on_depth_editingFinished() // all dives are shifted by an offset. static void shiftTime(QDateTime &dateTime) { - QVector<dive *> dives; - struct dive *d; - int i; - for_each_dive (i, d) { - if (d->selected) - dives.append(d); - } - timestamp_t when = dateTime.toTime_t(); if (current_dive && current_dive->when != when) { timestamp_t offset = when - current_dive->when; - Command::shiftTime(dives, (int)offset); + Command::shiftTime(getDiveSelection(), (int)offset); } } |