Getters should be constant

This commit is contained in:
Samuel Gaist 2014-11-06 00:31:11 +01:00
parent aaa1d12c68
commit 15838fb5e1
2 changed files with 8 additions and 8 deletions

View File

@ -17,7 +17,7 @@ QSimpleUpdater::QSimpleUpdater(QObject *parent)
} }
QString QSimpleUpdater::changeLog() { QString QSimpleUpdater::changeLog() const {
// Return the contents of the downloaded changelog // Return the contents of the downloaded changelog
if (!m_changelog.isEmpty()) { if (!m_changelog.isEmpty()) {
return m_changelog; return m_changelog;
@ -59,7 +59,7 @@ void QSimpleUpdater::checkForUpdates() {
} }
} }
QString QSimpleUpdater::latestVersion() { QString QSimpleUpdater::latestVersion() const {
// Return the application version referenced by the string // Return the application version referenced by the string
// that we downloaded // that we downloaded
if (!m_latest_version.isEmpty()) { if (!m_latest_version.isEmpty()) {
@ -75,7 +75,7 @@ QString QSimpleUpdater::latestVersion() {
} }
} }
QString QSimpleUpdater::installedVersion() { QString QSimpleUpdater::installedVersion() const {
// Return the string issued by the user in the setApplicationVersion() function // Return the string issued by the user in the setApplicationVersion() function
if (!m_installed_version.isEmpty()) { if (!m_installed_version.isEmpty()) {
return m_installed_version; return m_installed_version;
@ -103,7 +103,7 @@ void QSimpleUpdater::downloadLatestVersion() {
} }
} }
bool QSimpleUpdater::newerVersionAvailable() { bool QSimpleUpdater::newerVersionAvailable() const {
return m_new_version_available; return m_new_version_available;
} }

View File

@ -19,12 +19,12 @@ class QSimpleUpdater : public QObject {
public: public:
QSimpleUpdater(QObject *parent = 0); QSimpleUpdater(QObject *parent = 0);
QString changeLog(); QString changeLog() const;
void checkForUpdates(); void checkForUpdates();
QString latestVersion(); QString latestVersion() const;
QString installedVersion(); QString installedVersion() const;
void downloadLatestVersion(); void downloadLatestVersion();
bool newerVersionAvailable(); bool newerVersionAvailable() const;
public slots: public slots:
void setDownloadUrl(const QString &url); void setDownloadUrl(const QString &url);