From 8ee428e7cf518c9283a438c081e5f2c5b365f178 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Mon, 1 Oct 2018 16:41:38 +0200 Subject: [PATCH] Style --- src/blackmisc/input/joystickbutton.cpp | 6 ++++++ src/blackmisc/input/joystickbutton.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/blackmisc/input/joystickbutton.cpp b/src/blackmisc/input/joystickbutton.cpp index 98a3245f9..70447c4b6 100644 --- a/src/blackmisc/input/joystickbutton.cpp +++ b/src/blackmisc/input/joystickbutton.cpp @@ -24,6 +24,12 @@ namespace BlackMisc m_buttonIndex = buttonIndex; } + bool CJoystickButton::isValid() const + { + if (!m_deviceName.isEmpty() && m_buttonIndex >= 0) { return true; } + else { return false; } + } + void CJoystickButton::setButtonObject(CJoystickButton button) { this->m_buttonIndex = button.m_buttonIndex; diff --git a/src/blackmisc/input/joystickbutton.h b/src/blackmisc/input/joystickbutton.h index 8b7de74a7..0030ba338 100644 --- a/src/blackmisc/input/joystickbutton.h +++ b/src/blackmisc/input/joystickbutton.h @@ -61,7 +61,7 @@ namespace BlackMisc void setButtonIndex(int buttonIndex); //! Is valid? - bool isValid() const { return !m_deviceName.isEmpty() && m_buttonIndex >= 0 ? true : false; } + bool isValid() const; //! Set button object void setButtonObject(CJoystickButton button);