diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2016-12-16 16:02:21 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2016-12-16 16:30:12 +0000 |
commit | 0e71fd622c82f692dac7ea422988f5ba10e57e1f (patch) | |
tree | 981bf198fe0c962ac45593ad316690db031bb3f0 | |
parent | ac0ab6b8d6803c38a5ea317840de59bd9da6b8d6 (diff) |
Be const-correct from outside-in, not inside-out
https://isocpp.org/wiki/faq/const-correctness#logical-vs-physical-state
Change-Id: Ibf514c432fa330bee755cf3b0dcc002863821ec5
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
-rw-r--r-- | src/lib/qotaclient.cpp | 15 | ||||
-rw-r--r-- | src/lib/qotaclient.h | 11 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/qotaclient.cpp b/src/lib/qotaclient.cpp index 4fa3bee..30670a1 100644 --- a/src/lib/qotaclient.cpp +++ b/src/lib/qotaclient.cpp @@ -331,9 +331,9 @@ QOtaClient::~QOtaClient() \sa fetchRemoteInfoFinished(), updateAvailable, remoteInfo */ -bool QOtaClient::fetchRemoteInfo() const +bool QOtaClient::fetchRemoteInfo() { - Q_D(const QOtaClient); + Q_D(QOtaClient); if (!d->m_otaEnabled) return false; @@ -353,8 +353,9 @@ bool QOtaClient::fetchRemoteInfo() const \sa updateFinished(), fetchRemoteInfo, restartRequired, setRepositoryConfig */ -bool QOtaClient::update() const +bool QOtaClient::update() { + Q_D(const QOtaClient); if (!d->m_otaEnabled || !updateAvailable()) return false; @@ -372,9 +373,9 @@ bool QOtaClient::update() const \note This method mutates system's state/metadata. \sa rollbackFinished(), restartRequired */ -bool QOtaClient::rollback() const +bool QOtaClient::rollback() { - Q_D(const QOtaClient); + Q_D(QOtaClient); if (!d->m_otaEnabled) return false; @@ -452,9 +453,9 @@ bool QOtaClient::updateRemoteInfoOffline(const QString &packagePath) //! [refresh-info] */ -bool QOtaClient::refreshInfo() const +bool QOtaClient::refreshInfo() { - Q_D(const QOtaClient); + Q_D(QOtaClient); if (!d->m_otaEnabled) return false; diff --git a/src/lib/qotaclient.h b/src/lib/qotaclient.h index fda1727..66fbc2f 100644 --- a/src/lib/qotaclient.h +++ b/src/lib/qotaclient.h @@ -70,17 +70,16 @@ public: QString errorString() const; QString statusString() const; - Q_INVOKABLE bool fetchRemoteInfo() const; - Q_INVOKABLE bool update() const; - Q_INVOKABLE bool rollback() const; + Q_INVOKABLE bool fetchRemoteInfo(); + Q_INVOKABLE bool update(); + Q_INVOKABLE bool rollback(); Q_INVOKABLE bool updateOffline(const QString &packagePath); Q_INVOKABLE bool updateRemoteInfoOffline(const QString &packagePath); - Q_INVOKABLE bool refreshInfo() const; - + Q_INVOKABLE bool refreshInfo(); Q_INVOKABLE bool setRepositoryConfig(QOtaRepositoryConfig *config); - Q_INVOKABLE QOtaRepositoryConfig *repositoryConfig() const; Q_INVOKABLE bool removeRepositoryConfig(); Q_INVOKABLE bool isRepositoryConfigSet(QOtaRepositoryConfig *config) const; + Q_INVOKABLE QOtaRepositoryConfig *repositoryConfig() const; QString bootedVersion() const; QString bootedDescription() const; |