Rename pathsToNotifyWhenClosed -> pathsWithWaitSessions

This commit is contained in:
Max Brunsfeld
2018-01-05 17:49:44 -08:00
parent 386b786d93
commit 6f50f32116
4 changed files with 13 additions and 13 deletions

View File

@@ -139,8 +139,8 @@ class ApplicationDelegate {
return ipcRenderer.send('execute-javascript-in-dev-tools', code)
}
didCloseInitialPath (path) {
return ipcHelpers.call('window-method', 'didCloseInitialPath', path)
didClosePathWithWaitSession (path) {
return ipcHelpers.call('window-method', 'didClosePathWithWaitSession', path)
}
setWindowDocumentEdited (edited) {

View File

@@ -70,7 +70,7 @@ class AtomEnvironment {
this.loadTime = null
this.emitter = new Emitter()
this.disposables = new CompositeDisposable()
this.pathsToNotifyWhenClosed = new Set()
this.pathsWithWaitSessions = new Set()
// Public: A {DeserializerManager} instance
this.deserializers = new DeserializerManager(this)
@@ -360,7 +360,7 @@ class AtomEnvironment {
this.grammars.clear()
this.textEditors.clear()
this.views.clear()
this.pathsToNotifyWhenClosed.clear()
this.pathsWithWaitSessions.clear()
}
destroy () {
@@ -827,8 +827,8 @@ class AtomEnvironment {
let previousProjectPaths = this.project.getPaths()
this.disposables.add(this.project.onDidChangePaths(newPaths => {
for (let path of previousProjectPaths) {
if (this.pathsToNotifyWhenClosed.has(path) && !newPaths.includes(path)) {
this.applicationDelegate.didCloseInitialPath(path)
if (this.pathsWithWaitSessions.has(path) && !newPaths.includes(path)) {
this.applicationDelegate.didClosePathWithWaitSession(path)
}
}
previousProjectPaths = newPaths
@@ -836,8 +836,8 @@ class AtomEnvironment {
}))
this.disposables.add(this.workspace.onDidDestroyPaneItem(({item}) => {
const path = item.getPath && item.getPath()
if (this.pathsToNotifyWhenClosed.has(path)) {
this.applicationDelegate.didCloseInitialPath(path)
if (this.pathsWithWaitSessions.has(path)) {
this.applicationDelegate.didClosePathWithWaitSession(path)
}
}))
@@ -1326,7 +1326,7 @@ class AtomEnvironment {
fileLocationsToOpen.push(location)
}
if (location.notifyWhenClosed) this.pathsToNotifyWhenClosed.add(pathToOpen)
if (location.hasWaitSession) this.pathsWithWaitSessions.add(pathToOpen)
}
let restoredState = false

View File

@@ -793,7 +793,7 @@ class AtomApplication extends EventEmitter {
for (let i = 0; i < pathsToOpen.length; i++) {
const location = this.parsePathToOpen(pathsToOpen[i], executedFrom, addToLastWindow)
location.forceAddToWindow = addToLastWindow
location.notifyWhenClosed = pidToKillWhenClosed != null
location.hasWaitSession = pidToKillWhenClosed != null
locationsToOpen.push(location)
pathsToOpen[i] = location.pathToOpen
}
@@ -886,7 +886,7 @@ class AtomApplication extends EventEmitter {
this.waitSessionsByWindow.delete(window)
}
windowDidCloseInitialPath (window, initialPath) {
windowDidClosePathWithWaitSession (window, initialPath) {
const waitSessions = this.waitSessionsByWindow.get(window)
if (!waitSessions) return
for (let i = waitSessions.length - 1; i >= 0; i--) {

View File

@@ -411,8 +411,8 @@ class AtomWindow extends EventEmitter {
return this.atomApplication.saveState()
}
didCloseInitialPath (path) {
this.atomApplication.windowDidCloseInitialPath(this, path)
didClosePathWithWaitSession (path) {
this.atomApplication.windowDidClosePathWithWaitSession(this, path)
}
copy () {