summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-18 15:06:15 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-23 10:17:12 -0700
commitd815e0c9476ef62e6b84fb28ce48ab7cddefe77e (patch)
tree997b938f8080518d339797aae4630eb66b81e204 /mobile-widgets/qmlmanager.cpp
parentecb64d7e3e3c6c875defc9dc4aab01c65ccddf8a (diff)
downloadsubsurface-d815e0c9476ef62e6b84fb28ce48ab7cddefe77e.tar.gz
Parse: pass dive_table argument to parse_file()
To enable undo of divelog-importing it is crucial that parse_file() can parse into arbitrary dive tables. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 093f30eae..eb29061f5 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -255,7 +255,7 @@ void QMLManager::openLocalThenRemote(QString url)
QByteArray fileNamePrt = QFile::encodeName(url);
bool glo = qPrefCloudStorage::git_local_only();
prefs.git_local_only = true;
- int error = parse_file(fileNamePrt.data());
+ int error = parse_file(fileNamePrt.data(), &dive_table);
qPrefCloudStorage::set_git_local_only(glo);
if (error) {
appendTextToLog(QStringLiteral("loading dives from cache failed %1").arg(error));
@@ -324,7 +324,7 @@ void QMLManager::updateAllGlobalLists()
void QMLManager::mergeLocalRepo()
{
char *filename = NOCLOUD_LOCALSTORAGE;
- parse_file(filename);
+ parse_file(filename, &dive_table);
process_dives(true, false);
}
@@ -389,7 +389,7 @@ void QMLManager::finishSetup()
QMLPrefs::instance()->setCredentialStatus(qPref::CS_NOCLOUD);
saveCloudCredentials();
appendTextToLog(tr("working in no-cloud mode"));
- int error = parse_file(existing_filename);
+ int error = parse_file(existing_filename, &dive_table);
if (error) {
// we got an error loading the local file
setNotificationText(tr("Error parsing local storage, giving up"));
@@ -678,7 +678,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());
+ error = parse_file(fileNamePrt.data(), &dive_table);
}
if (!error) {
report_error("filename is now %s", fileNamePrt.data());