From 4128a250574dde7187247ab0093947fe91638647 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Fri, 21 Nov 2014 19:51:21 +0100 Subject: [PATCH] UpdateChecker: Made 'currentBuildNo' a const member variable. --- include/MUtils/UpdateChecker.h | 4 +++- src/UpdateChecker.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/MUtils/UpdateChecker.h b/include/MUtils/UpdateChecker.h index 3916846..7b1445e 100644 --- a/include/MUtils/UpdateChecker.h +++ b/include/MUtils/UpdateChecker.h @@ -73,7 +73,7 @@ namespace MUtils } update_status_t; - UpdateChecker(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode = false); + UpdateChecker(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode = false); ~UpdateChecker(void); const int getUpdateStatus(void) const { return m_status; } @@ -99,6 +99,8 @@ namespace MUtils const bool m_betaUpdates; const bool m_testMode; + const quint32 m_installedBuildNo; + const QString m_binaryWGet; const QString m_binaryGnuPG; const QString m_binaryKeys; diff --git a/src/UpdateChecker.cpp b/src/UpdateChecker.cpp index 490f9e8..ab6c11c 100644 --- a/src/UpdateChecker.cpp +++ b/src/UpdateChecker.cpp @@ -199,12 +199,13 @@ void UpdateCheckerInfo::resetInfo(void) // Constructor & Destructor //////////////////////////////////////////////////////////// -UpdateChecker::UpdateChecker(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const bool betaUpdates, const bool testMode) +UpdateChecker::UpdateChecker(const QString &binWGet, const QString &binGnuPG, const QString &binKeys, const quint32 &installedBuildNo, const bool betaUpdates, const bool testMode) : m_updateInfo(new UpdateCheckerInfo()), m_binaryWGet(binWGet), m_binaryGnuPG(binGnuPG), m_binaryKeys(binKeys), + m_installedBuildNo(installedBuildNo), m_betaUpdates(betaUpdates), m_testMode(testMode), m_maxProgress(getMaxProgress()) @@ -339,11 +340,11 @@ void UpdateChecker::checkForUpdates(void) if(m_success) { - if(m_updateInfo->m_buildNo > lamexp_version_build()) + if(m_updateInfo->m_buildNo > m_installedBuildNo) { setStatus(UpdateStatus_CompletedUpdateAvailable); } - else if(m_updateInfo->m_buildNo == lamexp_version_build()) + else if(m_updateInfo->m_buildNo == m_installedBuildNo) { setStatus(UpdateStatus_CompletedNoUpdates); }