summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp1
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp2
2 files changed, 1 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 44384bfb7..1445ea93b 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -909,6 +909,7 @@ void MainWindow::setupForAddAndPlan(const char *model)
displayed_dive.id = dive_getUniqID(&displayed_dive);
displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600;
displayed_dive.dc.model = strdup(model); // don't translate! this is stored in the XML file
+ dc_number = 1;
// setup the dive cylinders
DivePlannerPointsModel::instance()->clear();
DivePlannerPointsModel::instance()->setupCylinders();
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index c2a0c7e81..2202b96d3 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -798,7 +798,6 @@ void MainTab::acceptChanges()
addedId = displayed_dive.id;
}
struct dive *cd = current_dive;
- struct divecomputer *displayed_dc = get_dive_dc(&displayed_dive, dc_number);
// now check if something has changed and if yes, edit the selected dives that
// were identical with the master dive shown (and mark the divelist as changed)
if (!same_string(displayed_dive.suit, cd->suit))
@@ -1145,7 +1144,6 @@ void MainTab::divetype_Changed(int index)
{
if (editMode == IGNORE)
return;
- struct divecomputer *displayed_dc = get_dive_dc(&displayed_dive, dc_number);
displayed_dc->divemode = (enum dive_comp_type) index;
update_setpoint_events(&displayed_dive, displayed_dc);
markChangedWidget(ui.DiveType);