From 2c02ea592bc01914bbe48c9c472073cae69db9e4 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 28 Oct 2020 18:15:12 +0100 Subject: ControlObject: Inline the static toBool() method --- src/control/controlobject.cpp | 5 ----- src/control/controlobject.h | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/control') diff --git a/src/control/controlobject.cpp b/src/control/controlobject.cpp index 770064f83b..543046e576 100644 --- a/src/control/controlobject.cpp +++ b/src/control/controlobject.cpp @@ -94,11 +94,6 @@ double ControlObject::get(const ConfigKey& key) { return pCop ? pCop->get() : 0.0; } -// static -bool ControlObject::toBool(const ConfigKey& key) { - return ControlObject::get(key) > 0; -} - double ControlObject::getParameter() const { return m_pControl ? m_pControl->getParameter() : 0.0; } diff --git a/src/control/controlobject.h b/src/control/controlobject.h index b0c7cfaa72..22a6d49b93 100644 --- a/src/control/controlobject.h +++ b/src/control/controlobject.h @@ -86,7 +86,11 @@ class ControlObject : public QObject { // Instantly returns the value of the ControlObject static double get(const ConfigKey& key); - static bool toBool(const ConfigKey& key); + + /// Returns the boolean interpretation of the ControlObject's value. + static bool toBool(const ConfigKey& key) { + return ControlObject::get(key) > 0; + } // Sets the ControlObject value. May require confirmation by owner. inline void set(double value) { -- cgit v1.2.3