From 7e6dc5801c315d5c8caed75bcb2fa57d030a59a4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Dec 2016 19:08:27 +0100 Subject: Print a warning if we try to read a property that we didn't request. --- common/bufferadaptor.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common') 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: virtual QVariant getProperty(const QByteArray &key) const { + if (!mValues.contains(key)) { + qWarning() << "Tried to read value that is not avialable; Did you forget to call Query::request?"; + return QVariant{}; + } return mValues.value(key); } virtual void setProperty(const QByteArray &key, const QVariant &value) -- cgit v1.2.3