diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-27 10:05:19 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-27 10:06:33 -0800 |
commit | bbcc6fb3c2af0801f2bddde396230b11dc091ab3 (patch) | |
tree | fac8b7f894415b505d7a194556cffa8a41d10708 | |
parent | 8c1cc4524d19e05b816f3388448cacd735d64504 (diff) | |
download | subsurface-bbcc6fb3c2af0801f2bddde396230b11dc091ab3.tar.gz |
QML UI: if remote is same as local cache, don't load / process remote
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 7a226a542..884ea41d3 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -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(); |