diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-12-23 12:46:45 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-09 20:58:04 -0800 |
commit | 1593f2ebad25244fefabe606b32ee505d4d6087d (patch) | |
tree | a47251b4247cbe0c2b5b2fa568179f8abc4c25f9 /mobile-widgets/qmlmanager.cpp | |
parent | f542dc4030dda5dac1da1cc928f7a40a50919c4d (diff) | |
download | subsurface-1593f2ebad25244fefabe606b32ee505d4d6087d.tar.gz |
Import: merge dives trip-wise
The old way of merging log-files was not well defined: Trips
were recognized as the same if and only if the first dives
started at the same instant. Later dives did not matter.
Change this to merge dives if they are overlapping.
Moreover, on parsing and download generate trips in a separate
trip-table.
This will be fundamental for undo of dive-import: Firstly, we
don't want to mix trips of imported and not-yet imported dives.
Secondly, by merging trip-wise, we can autogroup the dives
in the import-data to trips and merge these at once. This will
simplify the code to decide to which trip dives should be
autogrouped.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 266092a9f..aadb413cc 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -339,8 +339,9 @@ void QMLManager::mergeLocalRepo() { char *filename = NOCLOUD_LOCALSTORAGE; struct dive_table table = { 0 }; - parse_file(filename, &table, &trip_table); - process_imported_dives(&table, false, false); + struct trip_table trips = { 0 }; + parse_file(filename, &table, &trips); + process_imported_dives(&table, &trips, false, false); } void QMLManager::copyAppLogToClipboard() |