UpdateChecker: Made 'currentBuildNo' a const member variable.

This commit is contained in:
LoRd_MuldeR 2014-11-21 19:51:21 +01:00
parent 92e36b7e6b
commit 4128a25057
2 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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);
}