 
   # FS Watcher helpers
   #
-
   registerWatcher:(path, stopWatching)->
+
     @watchers[path] = stop: stopWatching
 
+
   stopAllWatchers:->
+
     (watcher.stop() for own path, watcher of @watchers)
     @watchers = {}
 
+
   stopWatching:(pathToStop)->
+
     for own path, watcher of @watchers  when (path.indexOf pathToStop) is 0
       watcher.stop()
       delete @watchers[path]
 
+
   # Basics
   #
-
   cleanup:->
+
     @treeController.removeAllNodes()
     FSHelper.resetRegistry()
     @stopAllWatchers()

          @reloadPreviousState uid
        , yes

  isNodesHiddenFor:(uid)->
    return yes  if @getOption 'hideDotFiles'
    return (@appStorage.getValue('machinesDotFileChoices') or {})[uid]

  setNodesHidden:(uid, state)->
    prefs = @appStorage.getValue('machinesDotFileChoices') or {}
    prefs[uid] = state
    @appStorage.setValue 'machinesDotFileChoices', prefs

  getRecentFolders:->
    recentFolders = @appStorage.getValue('recentFolders')
    recentFolders = []  unless Array.isArray recentFolders
    return recentFolders

  setRecentFolder:(folderPath, callback)->
    recentFolders = @getRecentFolders()
    unless folderPath in recentFolders
      recentFolders.push folderPath
    recentFolders.sort (path)-> if path is folderPath then -1 else 0
    @appStorage.setValue 'recentFolders', recentFolders, callback

  unsetRecentFolder:(folderPath, callback)->
    recentFolders = @getRecentFolders()
    recentFolders = recentFolders.filter (path)->
      path.indexOf(folderPath) isnt 0

      then callback null, @treeController.nodes[path]
      else @expandFolders paths, callback


  reloadPreviousState:(uid)->

    recentFolders = @getRecentFolders()
    if uid
      recentFolders = recentFolders.filter (folder)->
