openFolder (pathname) {
    // TODO: Don't allow new files if quitting.
    if (!pathname || this.lifecycle === WindowLifecycle.QUITTED ||
      isSamePathSync(pathname, this._openedRootDirectory)) {
      return
    }

    if (this.lifecycle === WindowLifecycle.READY) {
      const { _accessor, browserWindow } = this
      const { menu: appMenu } = _accessor

      if (this._openedRootDirectory) {
        ipcMain.emit('watcher-unwatch-directory', browserWindow, this._openedRootDirectory)
      }

      appMenu.addRecentlyUsedDocument(pathname)
      this._openedRootDirectory = pathname
      ipcMain.emit('watcher-watch-directory', browserWindow, pathname)
      browserWindow.webContents.send('mt::open-directory', pathname)
    } else {
      this._directoryToOpen = pathname
    }
  }
Open a (new) directory and replaces the old one.

@param {string} pathname The directory path.