         folder.unread_entries -= feed.unread_entries
 
   #--------------------------------------------
-  # Store the currently selected feed in the global scope
-  #--------------------------------------------
-
-  set_current_feed = (feed)->
-    unset_current_folder()
-    unset_open_entry()
-    $rootScope.current_feed = feed
-
-  #--------------------------------------------
-  # Unset the currently selected feed in the global scope
-  #--------------------------------------------
-
-  unset_current_feed = ->
-    unset_open_entry()
-    $rootScope.current_feed = null
-
-  #--------------------------------------------
-  # Store the currently selected folder in the global scope
-  #--------------------------------------------
-
-  set_current_folder = (folder)->
-    unset_current_feed()
-    unset_open_entry()
-    $rootScope.current_folder = folder
-
-  #--------------------------------------------
-  # Unset the currently selected folder in the global scope
-  #--------------------------------------------
-
-  unset_current_folder = ->
-    unset_open_entry()
-    $rootScope.current_folder = null
-
-  #--------------------------------------------
-  # Store the currently open entry in the global scope
-  #--------------------------------------------
-
-  set_open_entry = (entry)->
-    $rootScope.open_entry = entry
-
-  #--------------------------------------------
-  # Unset the currently open entry in the global scope
-  #--------------------------------------------
-
-  unset_open_entry = ->
-    $rootScope.open_entry = null
-
-  #--------------------------------------------
-  # Store the currently open folder in the global scope
-  #--------------------------------------------
-
-  set_open_folder = (folder)->
-    $rootScope.current_open_folder = folder
-
-  #--------------------------------------------
-  # Unset the currently open folder in the global scope
-  #--------------------------------------------
-
-  unset_open_folder = ->
-    $rootScope.current_open_folder = null
-
-  #--------------------------------------------
   # Function to filter feeds in a given folder
   #--------------------------------------------
 

  #--------------------------------------------

  $scope.remove_from_folder = ->
    folder_id = $rootScope.current_feed.folder_id
    $rootScope.current_feed.folder_id = 'none'
    feed_removed_from_folder $rootScope.current_feed, folder_id

    $http.put('/folders/none.json', folder: {feed_id: $rootScope.current_feed.id})
    .error ->
      # Show alert
      $rootScope.error_managing_folders = true

  #--------------------------------------------

  update_unread_count = (entries, increment)->
    if currentFeedSvc.get()
      # if current_feed has value, all entries belong to the same feed which simplifies things
      if increment
        currentFeedSvc.get().unread_entries += entries.length
      else
        currentFeedSvc.get().unread_entries -= entries.length
    else
      # if current_feed has null value, each entry can belong to a different feed
      # we process each entry individually
