[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [sink/develop] common: Print a warning if we try to read a property that we didn't request.
From: Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date: 2016-12-09 15:45:48
Message-ID: E1cFNMq-0007L1-4z () code ! kde ! org
[Download RAW message or body]
Git commit 7e6dc5801c315d5c8caed75bcb2fa57d030a59a4 by Christian Mollekopf.
Committed on 06/12/2016 at 18:08.
Pushed by cmollekopf into branch 'develop'.
Print a warning if we try to read a property that we didn't request.
M +4 -0 common/bufferadaptor.h
https://commits.kde.org/sink/7e6dc5801c315d5c8caed75bcb2fa57d030a59a4
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)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic