diff options
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 | ||||
-rw-r--r-- | qt-ui/maintab.cpp | 6 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 6 | ||||
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 |
5 files changed, 10 insertions, 8 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 27eedb586..476812080 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1472,7 +1472,7 @@ void DivePlannerPointsModel::createPlan() plan(&diveplan, &cache, &tempDive, isPlanner()); copy_cylinders(stagingDive, tempDive); int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS]; - per_cylinder_mean_depth(tempDive, select_dc(&tempDive->dc), mean, duration); + per_cylinder_mean_depth(tempDive, select_dc(tempDive), mean, duration); for (int i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = tempDive->cylinder + i; if (cylinder_none(cyl)) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 378ee6163..660fc4f90 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -483,7 +483,7 @@ void MainTab::updateDiveInfo(int dive) get_gas_used(d, gases); QString volumes = get_volume_string(gases[0], true); int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS]; - per_cylinder_mean_depth(d, select_dc(&d->dc), mean, duration); + per_cylinder_mean_depth(d, select_dc(d), mean, duration); volume_t sac; QString SACs; if (mean[0] && duration[0]) { @@ -864,13 +864,13 @@ void MainTab::on_divemaster_textChanged() void MainTab::on_airtemp_textChanged(const QString &text) { - EDIT_SELECTED_DIVES(select_dc(&mydive->dc)->airtemp.mkelvin = parseTemperatureToMkelvin(text)); + EDIT_SELECTED_DIVES(select_dc(mydive)->airtemp.mkelvin = parseTemperatureToMkelvin(text)); markChangedWidget(ui.airtemp); } void MainTab::on_watertemp_textChanged(const QString &text) { - EDIT_SELECTED_DIVES(select_dc(&mydive->dc)->watertemp.mkelvin = parseTemperatureToMkelvin(text)); + EDIT_SELECTED_DIVES(select_dc(mydive)->watertemp.mkelvin = parseTemperatureToMkelvin(text)); markChangedWidget(ui.watertemp); } diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 02c424fe2..8ca3bfad3 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -507,14 +507,16 @@ void MainWindow::saveSplitterSizes() void MainWindow::on_actionPreviousDC_triggered() { - dc_number--; + unsigned nrdc = number_of_computers(current_dive); + dc_number = (dc_number + nrdc - 1) % nrdc; ui.InfoWidget->updateDiveInfo(selected_dive); ui.newProfile->plotDives(QList<struct dive *>() << (current_dive)); } void MainWindow::on_actionNextDC_triggered() { - dc_number++; + unsigned nrdc = number_of_computers(current_dive); + dc_number = (dc_number + 1) % nrdc; ui.InfoWidget->updateDiveInfo(selected_dive); ui.newProfile->plotDives(QList<struct dive *>() << (current_dive)); } diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 7412a7764..755dd9264 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -183,7 +183,7 @@ void DivePlotDataModel::calculateDecompression() struct dive *d = getDiveById(id()); if (!d) return; - struct divecomputer *dc = select_dc(&d->dc); + struct divecomputer *dc = select_dc(d); init_decompression(d); calculate_deco_information(d, dc, &pInfo, false); dataChanged(index(0, CEILING), index(pInfo.nr - 1, TISSUE_16)); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 9767de3e3..90ff5eeba 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -358,7 +358,7 @@ void ProfileWidget2::plotDives(QList<dive *> dives) // next get the dive computer structure - if there are no samples // let's create a fake profile that's somewhat reasonable for the // data that we have - struct divecomputer *currentdc = select_dc(&d->dc); + struct divecomputer *currentdc = select_dc(d); Q_ASSERT(currentdc); if (!currentdc || !currentdc->samples) { currentdc = fake_dc(currentdc); |