diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-15 21:52:31 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-16 10:42:10 +0200 |
commit | 1fe8dc00de4d9bb7072ec9677ec7f8e73e4fc769 (patch) | |
tree | a947f3af46738a60f0a2f3f3be0435cd23486271 /lib/e2ee | |
parent | 9c8c33ab0b2138b45cbfe29f4be235f631730826 (diff) | |
download | libquotient-1fe8dc00de4d9bb7072ec9677ec7f8e73e4fc769.tar.gz libquotient-1fe8dc00de4d9bb7072ec9677ec7f8e73e4fc769.zip |
QOlmAccount::needsSave() shouldn't be const
Making Qt signals const is an impossible commitment - once the signal
is out, you can't control if any called slot will change the emitting
class or not. The code compiles but const-ness is not preserved.
Diffstat (limited to 'lib/e2ee')
-rw-r--r-- | lib/e2ee/qolmaccount.cpp | 5 | ||||
-rw-r--r-- | lib/e2ee/qolmaccount.h | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/e2ee/qolmaccount.cpp b/lib/e2ee/qolmaccount.cpp index af9eb1bf..3339ce46 100644 --- a/lib/e2ee/qolmaccount.cpp +++ b/lib/e2ee/qolmaccount.cpp @@ -143,7 +143,7 @@ size_t QOlmAccount::maxNumberOfOneTimeKeys() const return olm_account_max_number_of_one_time_keys(m_account); } -size_t QOlmAccount::generateOneTimeKeys(size_t numberOfKeys) const +size_t QOlmAccount::generateOneTimeKeys(size_t numberOfKeys) { const size_t randomLength = olm_account_generate_one_time_keys_random_length(m_account, numberOfKeys); QByteArray randomBuffer = getRandom(randomLength); @@ -196,7 +196,8 @@ QByteArray QOlmAccount::signOneTimeKey(const QString &key) const return sign(j.toJson(QJsonDocument::Compact)); } -std::optional<QOlmError> QOlmAccount::removeOneTimeKeys(const QOlmSessionPtr &session) const +std::optional<QOlmError> QOlmAccount::removeOneTimeKeys( + const QOlmSessionPtr& session) { const auto error = olm_remove_one_time_keys(m_account, session->raw()); diff --git a/lib/e2ee/qolmaccount.h b/lib/e2ee/qolmaccount.h index 08301998..1f36919a 100644 --- a/lib/e2ee/qolmaccount.h +++ b/lib/e2ee/qolmaccount.h @@ -24,7 +24,7 @@ class QUOTIENT_API QOlmAccount : public QObject Q_OBJECT public: QOlmAccount(const QString &userId, const QString &deviceId, QObject *parent = nullptr); - ~QOlmAccount(); + ~QOlmAccount() override; //! Creates a new instance of OlmAccount. During the instantiation //! the Ed25519 fingerprint key pair and the Curve25519 identity key @@ -55,7 +55,7 @@ public: size_t maxNumberOfOneTimeKeys() const; //! Generates the supplied number of one time keys. - size_t generateOneTimeKeys(size_t numberOfKeys) const; + size_t generateOneTimeKeys(size_t numberOfKeys); //! Gets the OlmAccount's one time keys formatted as JSON. OneTimeKeys oneTimeKeys() const; @@ -97,7 +97,7 @@ public: OlmAccount *data(); Q_SIGNALS: - void needsSave() const; + void needsSave(); private: OlmAccount *m_account = nullptr; // owning |