diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:08:27 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-12-06 19:08:27 +0100 |
commit | 7e6dc5801c315d5c8caed75bcb2fa57d030a59a4 (patch) | |
tree | dadc8272789191c63fcd62fe95c9d5f42c2aa4a2 /common/bufferadaptor.h | |
parent | 319a303bdceba18d0e5629f3de7a2b85646223be (diff) | |
download | sink-7e6dc5801c315d5c8caed75bcb2fa57d030a59a4.tar.gz sink-7e6dc5801c315d5c8caed75bcb2fa57d030a59a4.zip |
Print a warning if we try to read a property that we didn't request.
Diffstat (limited to 'common/bufferadaptor.h')
-rw-r--r-- | common/bufferadaptor.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/bufferadaptor.h b/common/bufferadaptor.h index 2a40d18..8787d39 100644 --- a/common/bufferadaptor.h +++ b/common/bufferadaptor.h | |||
@@ -78,6 +78,10 @@ public: | |||
78 | 78 | ||
79 | virtual QVariant getProperty(const QByteArray &key) const | 79 | virtual QVariant getProperty(const QByteArray &key) const |
80 | { | 80 | { |
81 | if (!mValues.contains(key)) { | ||
82 | qWarning() << "Tried to read value that is not avialable; Did you forget to call Query::request?"; | ||
83 | return QVariant{}; | ||
84 | } | ||
81 | return mValues.value(key); | 85 | return mValues.value(key); |
82 | } | 86 | } |
83 | virtual void setProperty(const QByteArray &key, const QVariant &value) | 87 | virtual void setProperty(const QByteArray &key, const QVariant &value) |