QML UI: if remote is same as local cache, don't load / process remote

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-12-27 10:05:19 -08:00
parent 8c1cc4524d
commit bbcc6fb3c2

View file

@ -267,7 +267,15 @@ void QMLManager::loadDivesWithValidCredentials()
clear_dive_file_data();
QByteArray fileNamePrt = QFile::encodeName(url);
QString savedSHA(saved_git_id);
int error = parse_file(fileNamePrt.data());
if (savedSHA == saved_git_id) {
qDebug() << "local cache was current, no need to modify dive list";
appendTextToLog("Cloud sync shows local cache was current");
return;
}
qDebug() << "had" << savedSHA << "got" << saved_git_id << ", so let's reload";
if (!error) {
report_error("filename is now %s", fileNamePrt.data());
const char *error_string = get_error_string();