shortcut_catcher: rename a couple variables
Fix build, msg => message Fix warning use int32, not uint32 Also do a bit of refactoring.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 1999-2009 Haiku Inc. All rights reserved.
|
* Copyright 1999-2009 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -208,18 +208,18 @@ KeyCommandMap::MessageReceived(BMessage* message)
|
|||||||
switch (message->what) {
|
switch (message->what) {
|
||||||
case EXECUTE_COMMAND:
|
case EXECUTE_COMMAND:
|
||||||
{
|
{
|
||||||
BMessage substituteMessage;
|
BMessage actuatorMessage;
|
||||||
if (message->FindMessage("act", &substituteMessage) == B_OK) {
|
if (message->FindMessage("act", &actuatorMessage) == B_OK) {
|
||||||
if (fSyncSpecs.Lock()) {
|
if (fSyncSpecs.Lock()) {
|
||||||
fInjects.AddItem(new BMessage(substituteMessage));
|
fInjects.AddItem(new BMessage(actuatorMessage));
|
||||||
fSyncSpecs.Unlock();
|
fSyncSpecs.Unlock();
|
||||||
|
|
||||||
// This evil hack forces input_server to call Filter() on
|
// This evil hack forces input_server to call Filter() on
|
||||||
// us so we can process the injected event.
|
// us so we can process the injected event.
|
||||||
BPoint lmp;
|
BPoint where;
|
||||||
status_t err = fLastMouseMessage.FindPoint("where", &lmp);
|
status_t err = fLastMouseMessage.FindPoint("where", &where);
|
||||||
if (err == B_OK)
|
if (err == B_OK)
|
||||||
set_mouse_position((int32)lmp.x, (int32)lmp.y);
|
set_mouse_position((int32)where.x, (int32)where.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -269,13 +269,13 @@ KeyCommandMap::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
// Leave handling of add-ons shortcuts to Tracker
|
// Leave handling of add-ons shortcuts to Tracker
|
||||||
BString command;
|
BString command;
|
||||||
if (msg.FindString("command", &command) == B_OK) {
|
if (message.FindString("command", &command) == B_OK) {
|
||||||
BStringList paths;
|
BStringList paths;
|
||||||
BPathFinder::FindPaths(
|
BPathFinder::FindPaths(
|
||||||
B_FIND_PATH_ADD_ONS_DIRECTORY, "Tracker/",
|
B_FIND_PATH_ADD_ONS_DIRECTORY, "Tracker/",
|
||||||
paths);
|
paths);
|
||||||
bool foundAddOn = false;
|
bool foundAddOn = false;
|
||||||
for (uint32 i = 0; i < paths.CountStrings(); i++) {
|
for (int32 i = 0; i < paths.CountStrings(); i++) {
|
||||||
if (command.FindFirst(paths.StringAt(i))
|
if (command.FindFirst(paths.StringAt(i))
|
||||||
!= B_ERROR) {
|
!= B_ERROR) {
|
||||||
foundAddOn = true;
|
foundAddOn = true;
|
||||||
@@ -325,16 +325,21 @@ KeyCommandMap::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - KeyCommandMap private methods
|
||||||
|
|
||||||
|
|
||||||
//! Deletes an HKS-filled BList and its contents.
|
//! Deletes an HKS-filled BList and its contents.
|
||||||
void
|
void
|
||||||
KeyCommandMap::_DeleteHKSList(BList* l)
|
KeyCommandMap::_DeleteHKSList(BList* list)
|
||||||
{
|
{
|
||||||
if (l != NULL) {
|
if (list == NULL)
|
||||||
int num = l->CountItems();
|
return;
|
||||||
for (int i = 0; i < num; i++)
|
|
||||||
delete ((hks*) l->ItemAt(i));
|
int32 count = list->CountItems();
|
||||||
delete l;
|
for (int32 i = 0; i < count; i++)
|
||||||
}
|
delete (hks*)list->ItemAt(i);
|
||||||
|
|
||||||
|
delete list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user