mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Revert "Add Project::onDidChangePath()"
This reverts commit ed4acb02d8.
Conflicts:
src/project.coffee
This commit is contained in:
@@ -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: ->
|
||||
|
||||
Reference in New Issue
Block a user