summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-08-14 10:14:39 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-08-14 10:14:39 +0200
commitca84b995ca4fb8d0dd95faf3d888306614f194b9 (patch)
tree22b0953a2373ca39ac54c73613a4c2447ac723cf /src/control
parenteea551b770fb788c63430c2e459987fedd054220 (diff)
Replace ConfigKey::isNull()/isEmpty() checks with new isValid() method
Diffstat (limited to 'src/control')
-rw-r--r--src/control/control.cpp6
-rw-r--r--src/control/controlobject.cpp4
-rw-r--r--src/control/controlproxy.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/src/control/control.cpp b/src/control/control.cpp
index 99f72ce37f..3a412d7fe7 100644
--- a/src/control/control.cpp
+++ b/src/control/control.cpp
@@ -101,9 +101,9 @@ QSharedPointer<ControlDoublePrivate> ControlDoublePrivate::getControl(
bool bTrack,
bool bPersist,
double defaultValue) {
- VERIFY_OR_DEBUG_ASSERT(!key.isEmpty()) {
- qWarning() << "ControlDoublePrivate::getControl returning NULL"
- << "for empty ConfigKey.";
+ VERIFY_OR_DEBUG_ASSERT(key.isValid()) {
+ qWarning() << "ControlDoublePrivate::getControl returning nullptr"
+ << "for invalid ConfigKey.";
return nullptr;
}
diff --git a/src/control/controlobject.cpp b/src/control/controlobject.cpp
index 988681cc50..543046e576 100644
--- a/src/control/controlobject.cpp
+++ b/src/control/controlobject.cpp
@@ -31,8 +31,8 @@ ControlObject::ControlObject() {
ControlObject::ControlObject(ConfigKey key, bool bIgnoreNops, bool bTrack,
bool bPersist, double defaultValue)
: m_key(key) {
- // Don't bother looking up the control if key is NULL. Prevents log spew.
- if (!m_key.isNull()) {
+ // Don't bother looking up the control if key is invalid. Prevents log spew.
+ if (m_key.isValid()) {
m_pControl = ControlDoublePrivate::getControl(m_key,
ControlFlag::None,
this,
diff --git a/src/control/controlproxy.cpp b/src/control/controlproxy.cpp
index f0b93961a5..56b786a5e6 100644
--- a/src/control/controlproxy.cpp
+++ b/src/control/controlproxy.cpp
@@ -14,10 +14,10 @@ ControlProxy::ControlProxy(const char* g, const char* i, QObject* pParent, Contr
ControlProxy::ControlProxy(const ConfigKey& key, QObject* pParent, ControlFlags flags)
: QObject(pParent),
m_pControl(nullptr) {
- DEBUG_ASSERT(!key.isNull() || flags.testFlag(ControlFlag::AllowEmptyKey));
+ DEBUG_ASSERT(key.isValid() || flags.testFlag(ControlFlag::AllowEmptyKey));
m_key = key;
- if (!m_key.isNull()) {
+ if (m_key.isValid()) {
initialize(flags);
}
}
@@ -27,7 +27,7 @@ void ControlProxy::initialize(ControlFlags flags) {
DEBUG_ASSERT(!m_pControl);
// Prevent empty keys
- VERIFY_OR_DEBUG_ASSERT(!m_key.isNull() || flags.testFlag(ControlFlag::AllowEmptyKey)) {
+ VERIFY_OR_DEBUG_ASSERT(m_key.isValid() || flags.testFlag(ControlFlag::AllowEmptyKey)) {
return;
}