cleanup: move clearing of device nodes to clear_dive_file_data()

It makes no sense to keep the device nodes if all the other data
is cleared. Let's do this automatically and not explicitly.
This ensures that the function is also called on mobile.
Currently it was only called on desktop.

Weirdly, the parser-tests were expecting that the device nodes
were not reset by clear_dive_file_data() and therefore divecomputers
were accumulating in the test results. Thus, the additional
computers had to be removed from the expected test results.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-04-23 23:32:42 +02:00 committed by Dirk Hohndel
parent 52f93ea326
commit 17526ded58
11 changed files with 9 additions and 23 deletions

View file

@ -18,7 +18,6 @@
#include "core/color.h"
#include "core/device.h"
#include "core/divecomputer.h"
#include "core/divesitehelpers.h"
#include "core/errorhelper.h"
#include "core/file.h"
@ -653,7 +652,7 @@ void MainWindow::closeCurrentFile()
{
/* free the dives and trips */
clear_git_id();
MultiFilterSortModel::instance()->clear();
MultiFilterSortModel::instance()->clear(); // this clears all the core data structures
setCurrentFile(nullptr);
diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder);
MapWidget::instance()->reload();
@ -663,8 +662,6 @@ void MainWindow::closeCurrentFile()
setFileClean();
clear_events();
dcList.dcs.clear();
}
void MainWindow::updateCloudOnlineStatus()