aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-05 21:36:15 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-05 21:36:15 -0700
commit8af45342863f096aee1359b1702c774035466c58 (patch)
tree5d071dd432b4a4e8f3e3b7d45d23d2dd56246d8e /mobile-widgets
parentc3ab4dfc3e59515fd36cfa99c61f2b431f0480ea (diff)
downloadsubsurface-8af45342863f096aee1359b1702c774035466c58.tar.gz
QML UI: don't try to save again if we are already saving
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index bf9459b0f..0fc3c65a7 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -721,6 +721,10 @@ void QMLManager::saveChanges()
appendTextToLog("Don't save dives without loading from the cloud, first.");
return;
}
+ if (alreadySaving) {
+ appendTextToLog("Save operation already in progress.");
+ return;
+ }
appendTextToLog("Saving dives.");
git_storage_update_progress(0, "saveChanges"); // reset the timers
QString fileName;
@@ -732,15 +736,18 @@ void QMLManager::saveChanges()
setAccessingCloud(0);
qApp->processEvents(); // make sure that the notification is actually shown
}
+ alreadySaving = true;
if (save_dives(fileName.toUtf8().data())) {
appendTextToLog(get_error_string());
setAccessingCloud(-1);
+ alreadySaving = false;
return;
}
setAccessingCloud(-1);
appendTextToLog("Updated dive list saved.");
set_filename(fileName.toUtf8().data(), true);
mark_divelist_changed(false);
+ alreadySaving = false;
}
void QMLManager::undoDelete(int id)