Browse Source

Minor clean-up.

tags/2021-05-28
jules 10 years ago
parent
commit
12ab881353
2 changed files with 7 additions and 8 deletions
  1. +4
    -4
      modules/juce_events/native/juce_mac_MessageManager.mm
  2. +3
    -4
      modules/juce_gui_basics/components/juce_Component.cpp

+ 4
- 4
modules/juce_events/native/juce_mac_MessageManager.mm View File

@@ -53,7 +53,7 @@ public:
[[NSDistributedNotificationCenter defaultCenter] addObserver: delegate
selector: @selector (broadcastMessageCallback:)
name: getBroacastEventName()
name: getBroadcastEventName()
object: nil];
}
else
@@ -79,14 +79,14 @@ public:
[NSApp setDelegate: nil];
[[NSDistributedNotificationCenter defaultCenter] removeObserver: delegate
name: getBroacastEventName()
name: getBroadcastEventName()
object: nil];
}
[delegate release];
}
static NSString* getBroacastEventName()
static NSString* getBroadcastEventName()
{
return juceStringToNS ("juce_" + String::toHexString (File::getSpecialLocation (File::currentExecutableFile).hashCode64()));
}
@@ -356,7 +356,7 @@ void MessageManager::broadcastMessage (const String& message)
NSDictionary* info = [NSDictionary dictionaryWithObject: juceStringToNS (message)
forKey: nsStringLiteral ("message")];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName: AppDelegate::getBroacastEventName()
[[NSDistributedNotificationCenter defaultCenter] postNotificationName: AppDelegate::getBroadcastEventName()
object: nil
userInfo: info];
}


+ 3
- 4
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -2309,16 +2309,15 @@ void Component::internalModalInputAttempt()
//==============================================================================
void Component::postCommandMessage (const int commandId)
{
class CustomCommandMessage : public CallbackMessage
struct CustomCommandMessage : public CallbackMessage
{
public:
CustomCommandMessage (Component* const c, const int command)
: target (c), commandId (command) {}
void messageCallback() override
{
if (target.get() != nullptr) // (get() required for VS2003 bug)
target->handleCommandMessage (commandId);
if (Component* c = target.get())
c->handleCommandMessage (commandId);
}
private:


Loading…
Cancel
Save