diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-27 00:25:15 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-09 20:58:04 -0800 |
commit | 7e33369dc8b27b20385ab055b662e06bbf369784 (patch) | |
tree | af674ccdd1ccb67d4de84d68cb585b481d020fb3 /mobile-widgets | |
parent | ec37c71f5eeb7d4b0c4b8719b52583fadb0b8f4c (diff) | |
download | subsurface-7e33369dc8b27b20385ab055b662e06bbf369784.tar.gz |
Parser: add trip_table parameter to parsing functions
To allow parsing into arbitrary trip_tables, add the corresponding
parameter to the parsing functions and the parser state. Currently,
all callers pass the global trip_table so there should be no change
in functionality. These arguments will be replaced in subsequent commits.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index b78af626a..266092a9f 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -271,7 +271,7 @@ void QMLManager::openLocalThenRemote(QString url) QByteArray fileNamePrt = QFile::encodeName(url); bool glo = git_local_only; git_local_only = true; - int error = parse_file(fileNamePrt.data(), &dive_table); + int error = parse_file(fileNamePrt.data(), &dive_table, &trip_table); git_local_only = glo; if (error) { appendTextToLog(QStringLiteral("loading dives from cache failed %1").arg(error)); @@ -339,7 +339,7 @@ void QMLManager::mergeLocalRepo() { char *filename = NOCLOUD_LOCALSTORAGE; struct dive_table table = { 0 }; - parse_file(filename, &table); + parse_file(filename, &table, &trip_table); process_imported_dives(&table, false, false); } @@ -404,7 +404,7 @@ void QMLManager::finishSetup() QMLPrefs::instance()->setCredentialStatus(qPrefCloudStorage::CS_NOCLOUD); saveCloudCredentials(); appendTextToLog(tr("working in no-cloud mode")); - int error = parse_file(existing_filename, &dive_table); + int error = parse_file(existing_filename, &dive_table, &trip_table); if (error) { // we got an error loading the local file setNotificationText(tr("Error parsing local storage, giving up")); @@ -664,7 +664,7 @@ void QMLManager::loadDivesWithValidCredentials() error = git_load_dives(git, branch); } else { appendTextToLog(QString("didn't receive valid git repo, try again")); - error = parse_file(fileNamePrt.data(), &dive_table); + error = parse_file(fileNamePrt.data(), &dive_table, &trip_table); } if (!error) { report_error("filename is now %s", fileNamePrt.data()); |