mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't recreate the OSX Watcher class.
This commit is contained in:
@@ -3,10 +3,11 @@ class Watcher
|
||||
@watchedPaths: {}
|
||||
|
||||
@setup: ->
|
||||
__AAWatcher__ = OSX.JSCocoa.createClass_parentClass "__AAWatcher__", "NSObject"
|
||||
OSX.JSCocoa.addInstanceMethod_class_jsFunction_encoding "watcher:receivedNotification:forPath:", __AAWatcher__, @watcher_receivedNotification_forPath, "v:@@@@"
|
||||
if not OSX.__AAWatcher__
|
||||
OSX.__AAWatcher__ = OSX.JSCocoa.createClass_parentClass "__AAWatcher__", "NSObject"
|
||||
OSX.JSCocoa.addInstanceMethod_class_jsFunction_encoding "watcher:receivedNotification:forPath:", OSX.__AAWatcher__, @watcher_receivedNotification_forPath, "v:@@@@"
|
||||
|
||||
@delegate = __AAWatcher__.alloc.init
|
||||
@delegate = OSX.__AAWatcher__.alloc.init
|
||||
@queue = OSX.UKKQueue.alloc.init
|
||||
@queue.setDelegate @delegate
|
||||
|
||||
@@ -28,7 +29,7 @@ class Watcher
|
||||
@watchedPaths[path] = null
|
||||
@queue.removePathFromQueue path
|
||||
|
||||
# Delegate method for AAWatcher
|
||||
# Delegate method for __AAWatcher__
|
||||
@watcher_receivedNotification_forPath = (queue, notification, path) =>
|
||||
callbacks = @watchedPaths[path]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user