mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: don't try to save again if we are already saving
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c3ab4dfc3e
commit
8af4534286
1 changed files with 7 additions and 0 deletions
|
@ -721,6 +721,10 @@ void QMLManager::saveChanges()
|
||||||
appendTextToLog("Don't save dives without loading from the cloud, first.");
|
appendTextToLog("Don't save dives without loading from the cloud, first.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (alreadySaving) {
|
||||||
|
appendTextToLog("Save operation already in progress.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
appendTextToLog("Saving dives.");
|
appendTextToLog("Saving dives.");
|
||||||
git_storage_update_progress(0, "saveChanges"); // reset the timers
|
git_storage_update_progress(0, "saveChanges"); // reset the timers
|
||||||
QString fileName;
|
QString fileName;
|
||||||
|
@ -732,15 +736,18 @@ void QMLManager::saveChanges()
|
||||||
setAccessingCloud(0);
|
setAccessingCloud(0);
|
||||||
qApp->processEvents(); // make sure that the notification is actually shown
|
qApp->processEvents(); // make sure that the notification is actually shown
|
||||||
}
|
}
|
||||||
|
alreadySaving = true;
|
||||||
if (save_dives(fileName.toUtf8().data())) {
|
if (save_dives(fileName.toUtf8().data())) {
|
||||||
appendTextToLog(get_error_string());
|
appendTextToLog(get_error_string());
|
||||||
setAccessingCloud(-1);
|
setAccessingCloud(-1);
|
||||||
|
alreadySaving = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setAccessingCloud(-1);
|
setAccessingCloud(-1);
|
||||||
appendTextToLog("Updated dive list saved.");
|
appendTextToLog("Updated dive list saved.");
|
||||||
set_filename(fileName.toUtf8().data(), true);
|
set_filename(fileName.toUtf8().data(), true);
|
||||||
mark_divelist_changed(false);
|
mark_divelist_changed(false);
|
||||||
|
alreadySaving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::undoDelete(int id)
|
void QMLManager::undoDelete(int id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue