devices: add devices in Command::importTable()

Add a device_table parameters to Command::importTable() and
add_imported_dives(). The content of this table will be added
to the global device list (respectively removed on undo).

This is currently a no-op, as the parser doesn't yet fill
out the device table, but adds devices directly to the global
device table.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-10-17 16:07:39 +02:00 committed by Dirk Hohndel
parent fadea413cd
commit 39a4090c0a
17 changed files with 113 additions and 40 deletions

View file

@ -454,7 +454,7 @@ void QMLManager::mergeLocalRepo()
struct device_table devices;
struct filter_preset_table filter_presets;
parse_file(qPrintable(nocloud_localstorage()), &table, &trips, &sites, &devices, &filter_presets);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
}
void QMLManager::copyAppLogToClipboard()
@ -2242,7 +2242,7 @@ void QMLManager::importCacheRepo(QString repo)
QString repoPath = QString("%1/cloudstorage/%2").arg(system_default_directory()).arg(repo);
appendTextToLog(QString("importing %1").arg(repoPath));
parse_file(qPrintable(repoPath), &table, &trips, &sites, &devices, &filter_presets);
add_imported_dives(&table, &trips, &sites, IMPORT_MERGE_ALL_TRIPS);
add_imported_dives(&table, &trips, &sites, &devices, IMPORT_MERGE_ALL_TRIPS);
changesNeedSaving();
}