aboutsummaryrefslogtreecommitdiff
path: root/gui/Actions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/Actions.cpp')
-rw-r--r--gui/Actions.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/gui/Actions.cpp b/gui/Actions.cpp
index ce7d081991..f44479a5a8 100644
--- a/gui/Actions.cpp
+++ b/gui/Actions.cpp
@@ -42,8 +42,7 @@ Actions* Actions::Instance() {
}
Actions::Actions() :
- _mapping_active(false), _initialized(false)
-{
+ _mapping_active(false), _initialized(false) {
}
@@ -95,7 +94,7 @@ bool Actions::mappingActive() {
bool Actions::performMapped(unsigned int keyCode, bool pushed) {
int i;
- for (i=0; i<size(); i++) {
+ for (i = 0; i < size(); ++i) {
if (_action_mapping[i] == keyCode && _action_enabled[i])
return perform((ActionType)i, pushed);
}
@@ -112,7 +111,7 @@ bool Actions::loadMapping() {
return false;
tempo = ConfMan.get("action_mapping", domain()).c_str();
if (tempo && strlen(tempo)) {
- for (i=0; i<size(); i++) {
+ for (i = 0; i < size(); ++i) {
char x[7];
int j;
memset(x, 0, sizeof(x));
@@ -121,8 +120,7 @@ bool Actions::loadMapping() {
_action_mapping[i] = j;
}
return true;
- }
- else
+ } else
return false;
}
@@ -131,7 +129,7 @@ bool Actions::saveMapping() {
int i;
tempo[0] = '\0';
ConfMan.setInt("action_mapping_version", version(), domain());
- for (i=0; i<size(); i++) {
+ for (i = 0; i < size(); ++i) {
char x[10];
sprintf(x, "%.4x ", _action_mapping[i]);
strcat(tempo, x);
@@ -149,7 +147,7 @@ unsigned int Actions::getMapping(ActionType action) {
void Actions::setMapping(ActionType action, unsigned int keyCode) {
int i;
- for (i=0; i<size(); i++) {
+ for (i = 0; i < size(); ++i) {
if (_action_mapping[i] == keyCode)
_action_mapping[i] = 0;
}
@@ -157,8 +155,7 @@ void Actions::setMapping(ActionType action, unsigned int keyCode) {
_action_mapping[action] = keyCode;
}
-Key& Actions::getKeyAction(ActionType action)
-{
+Key& Actions::getKeyAction(ActionType action) {
return _key_action[action];
}