diff --git a/src/core/hint.cpp b/src/core/hint.cpp index c83947c..691a11e 100644 --- a/src/core/hint.cpp +++ b/src/core/hint.cpp @@ -55,13 +55,13 @@ bool Hint::contains(const QString &key) const return m_data.contains(key.toLower()); } -void Hint::setPrivateValue(const void *owner, const QString &key, const QVariant &value) +void Hint::setPrivateValue(const void *owner, const QString &key, const QVariant &value) const { QPair pk((quintptr)owner,key.toLower()); m_privateData.insert(pk, value); } -void Hint::setPrivateValue(const void *owner, const QString &key, QObject *value) +void Hint::setPrivateValue(const void *owner, const QString &key, QObject *value) const { QPair pk((quintptr)owner,key.toLower()); m_privateData.insert(pk, qVariantFromValue(value)); diff --git a/src/core/hint.h b/src/core/hint.h index d3872e8..101ad0d 100644 --- a/src/core/hint.h +++ b/src/core/hint.h @@ -79,7 +79,7 @@ public: * @param key the key * @param value the value */ - void setPrivateValue(const void *owner, const QString &key, const QVariant &value); + void setPrivateValue(const void *owner, const QString &key, const QVariant &value) const; /** * Sets the value for the key depending on the owner @@ -87,7 +87,7 @@ public: * @param key the key * @param value the value */ - void setPrivateValue(const void *owner, const QString &key, QObject *value); + void setPrivateValue(const void *owner, const QString &key, QObject *value) const; /** * The associated value of the key if present, returns the default value otherwise. @@ -110,7 +110,7 @@ private slots: private: QVariantHash m_data; - QHash, QVariant> m_privateData; + mutable QHash, QVariant> m_privateData; friend SNORE_EXPORT QDebug (::operator<<) ( QDebug, const Snore::Hint &);