summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-12 15:07:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-13 21:42:53 -0400
commit78e2560296bbcc9209dec947417feb8da5a5107c (patch)
tree58db2cdb02f11db7f98a6942b4d4a16da5dd49f1 /desktop-widgets/downloadfromdivecomputer.cpp
parent11a211fb02ad5443342d91b6967f150cb4f6d34f (diff)
downloadsubsurface-78e2560296bbcc9209dec947417feb8da5a5107c.tar.gz
Cleanup: Turn widget accessor-functions into simple pointers
The keeps track of different sub widgets needed by other parts of the code, notably: MainTab PlannerDetails PlannerSettingsWidget ProfileWidget2 DivePlannerWidget DiveListView Access to these widgets was provided with accessor functions. Now these functions were very weird: instead of simply returning pointers that were stored in the class, they accessed a data structure which describes the different application states. But this data structure was "duck-typed", so there was an implicit agreement at which position the pointers to the widgets were put inside. The widgets were then down-cast by the accessor functions. This might make sense if the individual widgets could for some reason be replaced by other widgets [dynamic plugins?], but even then it would be strange, as one would expect to get a pointer to some base class. Therefore, directly store the properly typed pointers to the widgets and simply remove the accessor functions. Why bother? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.cpp')
-rw-r--r--desktop-widgets/downloadfromdivecomputer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp
index df43dbdcb..1b88431ee 100644
--- a/desktop-widgets/downloadfromdivecomputer.cpp
+++ b/desktop-widgets/downloadfromdivecomputer.cpp
@@ -527,7 +527,7 @@ void DownloadFromDCWidget::on_ok_clicked()
delete_dive_from_table(&downloadTable, j);
}
- MainWindow::instance()->dive_list()->unselectDives();
+ MainWindow::instance()->dive_list->unselectDives();
if (downloadTable.nr > 0) {
// remember the last downloaded dive (on most dive computers this will be the chronologically
@@ -542,8 +542,8 @@ void DownloadFromDCWidget::on_ok_clicked()
int idx = get_idx_by_uniq_id(uniqId);
// this shouldn't be necessary - but there are reports that somehow existing dives stay selected
// (but not visible as selected)
- MainWindow::instance()->dive_list()->unselectDives();
- MainWindow::instance()->dive_list()->selectDive(idx, true);
+ MainWindow::instance()->dive_list->unselectDives();
+ MainWindow::instance()->dive_list->selectDive(idx, true);
}
if (ostcFirmwareCheck && currentState == DONE) {