summaryrefslogtreecommitdiff
path: root/src/touchmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
commit694e07d193e7c5758a7d672b45668651b034003d (patch)
tree20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/touchmanager.cpp
parentc9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff)
downloadplus-694e07d193e7c5758a7d672b45668651b034003d.tar.gz
plus-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2
plus-694e07d193e7c5758a7d672b45668651b034003d.tar.xz
plus-694e07d193e7c5758a7d672b45668651b034003d.zip
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/touchmanager.cpp')
-rw-r--r--src/touchmanager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index b7db9d83f..f3adecf8e 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -328,11 +328,14 @@ bool TouchManager::processEvent(const MouseInput &mouseInput)
return false;
}
-bool TouchManager::isActionActive(const int index) const
+bool TouchManager::isActionActive(const InputActionT index) const
{
- if (index < 0 || index >= actionsSize)
+ if (static_cast<int>(index) < 0 ||
+ static_cast<int>(index) >= actionsSize)
+ {
return false;
- return mActions[index];
+ }
+ return mActions[static_cast<size_t>(index)];
}
void TouchManager::resize(const int width, const int height)
@@ -670,5 +673,6 @@ void TouchManager::setTempHide(const bool b)
void TouchManager::executeAction(const std::string &event)
{
- inputManager.executeAction(config.getIntValue(event));
+ inputManager.executeAction(static_cast<InputActionT>(
+ config.getIntValue(event)));
}