mac/menu: replace app.command usage with event.command

This commit is contained in:
der richter 2024-03-03 16:53:05 +01:00
parent 37990597c7
commit 95d08df7a7
1 changed files with 2 additions and 2 deletions

View File

@ -338,7 +338,7 @@ class MenuBar: NSObject {
if panel.runModal() == .OK { if panel.runModal() == .OK {
"loadlist \"\(panel.urls[0].path)\"".withCString { "loadlist \"\(panel.urls[0].path)\"".withCString {
(NSApp as? Application)?.queueCommand(UnsafeMutablePointer<CChar>(mutating: $0)) EventsResponder.sharedInstance().queueCommand(UnsafeMutablePointer<CChar>(mutating: $0))
} }
} }
} }
@ -366,7 +366,7 @@ class MenuBar: NSObject {
@objc func command(_ menuItem: NSMenuItem) { @objc func command(_ menuItem: NSMenuItem) {
guard let menuConfig = getConfigFromMenu(menuItem: menuItem) else { return } guard let menuConfig = getConfigFromMenu(menuItem: menuItem) else { return }
menuConfig.command.withCString { menuConfig.command.withCString {
(NSApp as? Application)?.queueCommand(UnsafeMutablePointer<CChar>(mutating: $0)) EventsResponder.sharedInstance().queueCommand(UnsafeMutablePointer<CChar>(mutating: $0))
} }
} }