core: move process_import_dives() and related functions to divelog

These functions accessed the global divelog make this explicit.

I'm still not happy about the situation, because these functions
access global state, such as the selection. I think these
should be moved up the call-chain.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-19 22:45:25 +02:00 committed by bstoeger
parent b34116e2e2
commit 176f544106
14 changed files with 500 additions and 494 deletions

View file

@ -565,11 +565,11 @@ void DownloadFromDCWidget::on_ok_clicked()
if (currentState != DONE && currentState != ERRORED)
return;
int flags = IMPORT_IS_DOWNLOADED;
int flags = import_flags::is_downloaded;
if (preferDownloaded())
flags |= IMPORT_PREFER_IMPORTED;
flags |= import_flags::prefer_imported;
if (ui.createNewTrip->isChecked())
flags |= IMPORT_ADD_TO_NEW_TRIP;
flags |= import_flags::add_to_new_trip;
diveImportedModel->recordDives(flags);