 DaemonItem = require "./daemon-item"
 #atom.project.rootDirectories[0].path
-
-clone = (obj) ->
-  return obj if (null == obj || "object" != typeof obj)
-  copy = obj.constructor()
-  for attr of obj
-    console.log "clone #{obj[attr]}"
-    copy[attr] = obj[attr] if (obj.hasOwnProperty(attr))
-  # for (var attr in obj) {
-  #     if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
-  # }
-  return copy
-
 
 module.exports =
 class DaemonItemCollection

    return false

  addCommands: (item) ->
    atom.commands.add 'atom-workspace',"smart-daemon-control:configure-#{item.name}", =>
      # console.log @items
      @eventBus.emit 'daemon-item-configure-view:show', @items[item.id]


    #update check item
    if @checks[item.cmdCheck]?
      # console.log "check:"
      for i,key in @checks[item.cmdCheck]
        if i.id==item.id
          # console.log "found"
          @checks[item.cmdCheck].splice key,1
          break;
      @checks[item.cmdCheck].push item
