diff --git a/src/add-ons/input_server/filters/shortcut_catcher/CommandExecutor.cpp b/src/add-ons/input_server/filters/shortcut_catcher/CommandExecutor.cpp index 6f64e539cd..baa12ffd30 100644 --- a/src/add-ons/input_server/filters/shortcut_catcher/CommandExecutor.cpp +++ b/src/add-ons/input_server/filters/shortcut_catcher/CommandExecutor.cpp @@ -22,6 +22,7 @@ #include "CommandActuators.h" CommandExecutor::CommandExecutor() + : BLooper("Shortcuts commands executor") { // empty } @@ -33,9 +34,9 @@ CommandExecutor::~CommandExecutor() } -// Returns true if it is returning valid results into (*setBegin) and -// (*setEnd). If returning true, (*setBegin) now points to the first char in a -// new word, and (*setEnd) now points to the char after the last char in the +// Returns true if it is returning valid results into (*setBegin) and +// (*setEnd). If returning true, (*setBegin) now points to the first char in a +// new word, and (*setEnd) now points to the char after the last char in the // word, which has been set to a NUL byte. bool CommandExecutor::GetNextWord(char** setBegin, char** setEnd) const @@ -43,16 +44,16 @@ CommandExecutor::GetNextWord(char** setBegin, char** setEnd) const char* next = *setEnd; // we'll start one after the end of the last one... while (next++) { - if (*next == '\0') + if (*next == '\0') return false; // no words left! - else if (*next <= ' ') + else if (*next <= ' ') *next = '\0'; - else + else break; // found a non-whitespace char! } *setBegin = next; // we found the first char! - + while (next++) { if (*next <= ' ') { *next = '\0'; // terminate the word @@ -73,13 +74,13 @@ CommandExecutor::MessageReceived(BMessage* msg) { BMessage actMessage; void* asyncData; - if ((msg->FindMessage("act", &actMessage) == B_NO_ERROR) + if ((msg->FindMessage("act", &actMessage) == B_NO_ERROR) && (msg->FindPointer("adata", &asyncData) == B_NO_ERROR)) { BArchivable* arcObj = instantiate_object(&actMessage); if (arcObj) { CommandActuator* act = dynamic_cast(arcObj); - - if (act) + + if (act) act->KeyEventAsync(msg, asyncData); delete arcObj; } diff --git a/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp b/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp index cc499af9be..a5bcf30283 100644 --- a/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp +++ b/src/add-ons/input_server/filters/shortcut_catcher/KeyCommandMap.cpp @@ -64,6 +64,7 @@ private: KeyCommandMap::KeyCommandMap(const char* file) : + BLooper("Shortcuts map watcher"), fSpecs(NULL) { fFileName = new char[strlen(file) + 1];