From 672b4d78005b6052fce8541590b6f4952aa668d0 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Thu, 21 Oct 2010 09:00:07 +0000 Subject: [PATCH] Give a better name than the default "user thread" to Shortcuts's input_server filter BLoopers, too. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39038 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../shortcut_catcher/CommandExecutor.cpp | 21 ++++++++++--------- .../shortcut_catcher/KeyCommandMap.cpp | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) 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];