From bbcc6fb3c2af0801f2bddde396230b11dc091ab3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 27 Dec 2015 10:05:19 -0800 Subject: QML UI: if remote is same as local cache, don't load / process remote Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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(); -- cgit v1.2.3-70-g09d2