From b55357c4bffafa629453abdfd6bb411d89ec5f25 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Jul 2014 22:17:32 +0300 Subject: Rename KeySortFunctor into InputActionSortFunctor. --- src/CMakeLists.txt | 2 +- src/Makefile.am | 2 +- src/input/inputactionsortfunctor.h | 39 ++++++++++++++++++++++++++++++++++++++ src/input/inputmanager.cpp | 4 ++-- src/input/keysortfunctor.h | 39 -------------------------------------- 5 files changed, 43 insertions(+), 43 deletions(-) create mode 100644 src/input/inputactionsortfunctor.h delete mode 100644 src/input/keysortfunctor.h (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f960eb857..e60344b09 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -807,6 +807,7 @@ SET(SRCS input/inputaction.h input/inputactiondata.h input/inputactionmap.h + input/inputactionsortfunctor.h input/inputcondition.h input/inputfunction.h input/inputitem.h @@ -819,7 +820,6 @@ SET(SRCS input/keyboardconfig.cpp input/keyboardconfig.h input/keyinput.h - input/keysortfunctor.h input/multitouchmanager.cpp input/multitouchmanager.h localconsts.h diff --git a/src/Makefile.am b/src/Makefile.am index fe7df4c46..39780b5bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -929,6 +929,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ input/inputaction.h \ input/inputactiondata.h \ input/inputactionmap.h \ + input/inputactionsortfunctor.h \ input/inputcondition.h \ input/inputfunction.h \ input/inputitem.h \ @@ -940,7 +941,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ input/keyboardconfig.cpp \ input/keyboardconfig.h \ input/keyinput.h \ - input/keysortfunctor.h \ input/multitouchmanager.cpp \ input/multitouchmanager.h \ localconsts.h \ diff --git a/src/input/inputactionsortfunctor.h b/src/input/inputactionsortfunctor.h new file mode 100644 index 000000000..1e79cc27e --- /dev/null +++ b/src/input/inputactionsortfunctor.h @@ -0,0 +1,39 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef INPUT_INPUTACTIONSORTFUNCTOR_H +#define INPUT_INPUTACTIONSORTFUNCTOR_H + +#include "input/inputactiondata.h" + +#include "localconsts.h" + +class InputActionSortFunctor final +{ + public: + bool operator() (const int key1, const int key2) const + { + return keys[key1].priority >= keys[key2].priority; + } + + const InputActionData *keys; +}; + +#endif // INPUT_INPUTACTIONSORTFUNCTOR_H diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 429297cfd..68950f4cf 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -25,9 +25,9 @@ #include "touchmanager.h" #include "input/inputactionmap.h" +#include "input/inputactionsortfunctor.h" #include "input/joystick.h" #include "input/keyboardconfig.h" -#include "input/keysortfunctor.h" #include "being/localplayer.h" #ifdef USE_SDL2 #include "input/multitouchmanager.h" @@ -64,7 +64,7 @@ extern QuitDialog *quitDialog; namespace { - KeySortFunctor inputActionDataSorter; + InputActionSortFunctor inputActionDataSorter; } // namespace InputManager::InputManager() : diff --git a/src/input/keysortfunctor.h b/src/input/keysortfunctor.h deleted file mode 100644 index fedb4c395..000000000 --- a/src/input/keysortfunctor.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef INPUT_KEYSORTFUNCTOR_H -#define INPUT_KEYSORTFUNCTOR_H - -#include "input/inputactiondata.h" - -#include "localconsts.h" - -class KeySortFunctor final -{ - public: - bool operator() (const int key1, const int key2) const - { - return keys[key1].priority >= keys[key2].priority; - } - - const InputActionData *keys; -}; - -#endif // INPUT_KEYSORTFUNCTOR_H -- cgit v1.2.3-60-g2f50