Revert "Add Project::onDidChangePath()"

This reverts commit ed4acb02d8.

Conflicts:
	src/project.coffee
This commit is contained in:
Ben Ogle
2014-09-10 11:56:38 -07:00
parent 40b32930cf
commit 49937b2956

View File

@@ -6,9 +6,7 @@ fs = require 'fs-plus'
Q = require 'q'
{deprecate} = require 'grim'
{Model} = require 'theorist'
{Subscriber} = require 'emissary'
EmitterMixin = require('emissary').Emitter
{Emitter} = require 'event-kit'
{Emitter, Subscriber} = require 'emissary'
Serializable = require 'serializable'
TextBuffer = require 'text-buffer'
{Directory} = require 'pathwatcher'
@@ -35,7 +33,6 @@ class Project extends Model
constructor: ({path, @buffers}={}) ->
@buffers ?= []
@emitter = new Emitter
for buffer in @buffers
do (buffer) =>
@@ -43,29 +40,6 @@ class Project extends Model
@setPath(path)
###
Section: Event Subscription
###
# Essential: Invoke the given callback when the project's path has changed.
#
# * `callback` {Function}
# * `path` the new path
onDidChangePath: (callback) ->
@emitter.on 'did-change-path', callback
on: (eventName) ->
switch eventName
when 'path-changed'
deprecate 'Use Project::onDidChangePath instead'
else
deprecate 'Project::on is deprecated. Use event subscription methods instead.'
EmitterMixin::on.apply(this, arguments)
###
Section: Methods
###
serializeParams: ->
path: @path
buffers: _.compact(@buffers.map (buffer) -> buffer.serialize() if buffer.isRetained())
@@ -111,8 +85,7 @@ class Project extends Model
else
@rootDirectory = null
@emit 'path-changed'
@emitter.emit 'did-change-path', @getPath()
@emit "path-changed"
# Public: Returns the root {Directory} object for this project.
getRootDirectory: ->