From b53ebb699f271f846f56255e0f56c6f98327b628 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sun, 31 Mar 2019 11:45:02 +0200 Subject: [PATCH] Remove version specific header files for KeyboardInput The headers were identical after no longer using the abstract class for platform independence. --- build_scripts/qt/sources.pri | 5 ++- src/tabcontrollers/UtilitiesTabController.cpp | 5 --- src/tabcontrollers/UtilitiesTabController.h | 6 +--- .../keyboardinput/KeyboardInput.h | 31 +++++++------------ .../keyboardinput/KeyboardInputDummy.cpp | 2 +- .../keyboardinput/KeyboardInputDummy.h | 18 ----------- .../keyboardinput/KeyboardInputWindows.cpp | 2 +- .../keyboardinput/KeyboardInputWindows.h | 18 ----------- 8 files changed, 16 insertions(+), 71 deletions(-) delete mode 100644 src/tabcontrollers/keyboardinput/KeyboardInputDummy.h delete mode 100644 src/tabcontrollers/keyboardinput/KeyboardInputWindows.h diff --git a/build_scripts/qt/sources.pri b/build_scripts/qt/sources.pri index 23e9cb3..8a66f83 100644 --- a/build_scripts/qt/sources.pri +++ b/build_scripts/qt/sources.pri @@ -30,6 +30,7 @@ HEADERS += src/overlaycontroller.h \ src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/AudioManager.h \ src/tabcontrollers/PttController.h \ + src/tabcontrollers/keyboardinput/KeyboardInput.h \ src/utils/Matrix.h \ src/utils/ChaperoneUtils.h \ src/quaternion/quaternion.h \ @@ -47,13 +48,11 @@ HEADERS += src/overlaycontroller.h \ win32 { SOURCES += src/tabcontrollers/audiomanager/AudioManagerWindows.cpp \ src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp - HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h \ - src/tabcontrollers/keyboardinput/KeyboardInputWindows.h + HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h } !win32 { SOURCES += src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp - HEADERS += src/tabcontrollers/keyboardinput/KeyboardInputDummy.h } win32-msvc { diff --git a/src/tabcontrollers/UtilitiesTabController.cpp b/src/tabcontrollers/UtilitiesTabController.cpp index 06e28aa..6b70ea4 100644 --- a/src/tabcontrollers/UtilitiesTabController.cpp +++ b/src/tabcontrollers/UtilitiesTabController.cpp @@ -4,11 +4,6 @@ #include "../overlaycontroller.h" #include #include -#ifdef _WIN32 -# include "keyboardinput/KeyboardInputWindows.h" -#else -# include "keyboardinput/KeyboardInputDummy.h" -#endif // application namespace namespace advsettings diff --git a/src/tabcontrollers/UtilitiesTabController.h b/src/tabcontrollers/UtilitiesTabController.h index d31862a..e97cb60 100644 --- a/src/tabcontrollers/UtilitiesTabController.h +++ b/src/tabcontrollers/UtilitiesTabController.h @@ -5,11 +5,7 @@ #include #include #include -#ifdef WIN32 -# include "keyboardinput/KeyboardInputWindows.h" -#else -# include "keyboardinput/KeyboardInputDummy.h" -#endif +#include "keyboardinput/KeyboardInput.h" class QQuickWindow; // application namespace diff --git a/src/tabcontrollers/keyboardinput/KeyboardInput.h b/src/tabcontrollers/keyboardinput/KeyboardInput.h index a4e1ba7..d1bff88 100644 --- a/src/tabcontrollers/keyboardinput/KeyboardInput.h +++ b/src/tabcontrollers/keyboardinput/KeyboardInput.h @@ -3,25 +3,16 @@ #include #include -// application namespace -namespace advsettings +namespace keyboardinput { -class AudioTabController; +void sendKeyboardInput( QString input ); +void sendKeyboardEnter(); +void sendKeyboardBackspace( const int count ); +void sendKeyboardAltTab(); +void sendKeyboardAltEnter(); +void sendMediaNextSong(); +void sendMediaPreviousSong(); +void sendMediaPausePlay(); +void sendMediaStopSong(); -class KeyboardInput -{ -public: - virtual ~KeyboardInput() {} - - virtual void sendKeyboardInput( QString input ) = 0; - virtual void sendKeyboardEnter() = 0; - virtual void sendKeyboardBackspace( const int count ) = 0; - virtual void sendKeyboardAltTab() = 0; - virtual void sendKeyboardAltEnter() = 0; - virtual void sendMediaNextSong() = 0; - virtual void sendMediaPreviousSong() = 0; - virtual void sendMediaPausePlay() = 0; - virtual void sendMediaStopSong() = 0; -}; - -} // namespace advsettings +} // namespace keyboardinput diff --git a/src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp b/src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp index bd92747..8bfa9bb 100644 --- a/src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp +++ b/src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp @@ -1,4 +1,4 @@ -#include "KeyboardInputDummy.h" +#include "KeyboardInput.h" // Used to get the compiler to shut up about C4100: unreferenced formal // parameter. The cast is to get GCC to shut up about it. diff --git a/src/tabcontrollers/keyboardinput/KeyboardInputDummy.h b/src/tabcontrollers/keyboardinput/KeyboardInputDummy.h deleted file mode 100644 index d1bff88..0000000 --- a/src/tabcontrollers/keyboardinput/KeyboardInputDummy.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include - -namespace keyboardinput -{ -void sendKeyboardInput( QString input ); -void sendKeyboardEnter(); -void sendKeyboardBackspace( const int count ); -void sendKeyboardAltTab(); -void sendKeyboardAltEnter(); -void sendMediaNextSong(); -void sendMediaPreviousSong(); -void sendMediaPausePlay(); -void sendMediaStopSong(); - -} // namespace keyboardinput diff --git a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp b/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp index 0276e6d..586bef5 100644 --- a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp +++ b/src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp @@ -1,4 +1,4 @@ -#include "KeyboardInputWindows.h" +#include "KeyboardInput.h" #include #include "easylogging++.h" diff --git a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.h b/src/tabcontrollers/keyboardinput/KeyboardInputWindows.h deleted file mode 100644 index d1bff88..0000000 --- a/src/tabcontrollers/keyboardinput/KeyboardInputWindows.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include -#include - -namespace keyboardinput -{ -void sendKeyboardInput( QString input ); -void sendKeyboardEnter(); -void sendKeyboardBackspace( const int count ); -void sendKeyboardAltTab(); -void sendKeyboardAltEnter(); -void sendMediaNextSong(); -void sendMediaPreviousSong(); -void sendMediaPausePlay(); -void sendMediaStopSong(); - -} // namespace keyboardinput