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
This commit is contained in:
Philippe Houdoin 2010-10-21 09:00:07 +00:00
parent bb188e4d73
commit 672b4d7800
2 changed files with 12 additions and 10 deletions

View File

@ -22,6 +22,7 @@
#include "CommandActuators.h" #include "CommandActuators.h"
CommandExecutor::CommandExecutor() CommandExecutor::CommandExecutor()
: BLooper("Shortcuts commands executor")
{ {
// empty // empty
} }
@ -33,9 +34,9 @@ CommandExecutor::~CommandExecutor()
} }
// Returns true if it is returning valid results into (*setBegin) and // Returns true if it is returning valid results into (*setBegin) and
// (*setEnd). If returning true, (*setBegin) now points to the first char in a // (*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 // new word, and (*setEnd) now points to the char after the last char in the
// word, which has been set to a NUL byte. // word, which has been set to a NUL byte.
bool bool
CommandExecutor::GetNextWord(char** setBegin, char** setEnd) const 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... char* next = *setEnd; // we'll start one after the end of the last one...
while (next++) { while (next++) {
if (*next == '\0') if (*next == '\0')
return false; // no words left! return false; // no words left!
else if (*next <= ' ') else if (*next <= ' ')
*next = '\0'; *next = '\0';
else else
break; // found a non-whitespace char! break; // found a non-whitespace char!
} }
*setBegin = next; // we found the first char! *setBegin = next; // we found the first char!
while (next++) { while (next++) {
if (*next <= ' ') { if (*next <= ' ') {
*next = '\0'; // terminate the word *next = '\0'; // terminate the word
@ -73,13 +74,13 @@ CommandExecutor::MessageReceived(BMessage* msg)
{ {
BMessage actMessage; BMessage actMessage;
void* asyncData; 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)) { && (msg->FindPointer("adata", &asyncData) == B_NO_ERROR)) {
BArchivable* arcObj = instantiate_object(&actMessage); BArchivable* arcObj = instantiate_object(&actMessage);
if (arcObj) { if (arcObj) {
CommandActuator* act = dynamic_cast<CommandActuator*>(arcObj); CommandActuator* act = dynamic_cast<CommandActuator*>(arcObj);
if (act) if (act)
act->KeyEventAsync(msg, asyncData); act->KeyEventAsync(msg, asyncData);
delete arcObj; delete arcObj;
} }

View File

@ -64,6 +64,7 @@ private:
KeyCommandMap::KeyCommandMap(const char* file) KeyCommandMap::KeyCommandMap(const char* file)
: :
BLooper("Shortcuts map watcher"),
fSpecs(NULL) fSpecs(NULL)
{ {
fFileName = new char[strlen(file) + 1]; fFileName = new char[strlen(file) + 1];