mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-27 02:20:05 +00:00
Minor clean-up.
This commit is contained in:
parent
5c48d16548
commit
12ab881353
2 changed files with 7 additions and 8 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue