static void feedlist_unselect (void) { SELECTED = NULL; itemview_set_displayed_node (NULL); itemview_update (); itemlist_unload (FALSE /* mark all read */); feed_list_view_select (NULL); liferea_shell_update_feed_menu (TRUE, FALSE, FALSE); liferea_shell_update_allitems_actions (FALSE, FALSE); }
/** * To be called whenever an itemset was updated. If it is the * displayed itemset it will be merged against the item view. */ void itemlist_merge_itemset (itemSetPtr itemSet) { debug_enter ("itemlist_merge_itemset"); if (itemlist_itemset_is_valid (itemSet)) { debug_start_measurement (DEBUG_GUI); itemset_foreach (itemSet, itemlist_merge_item); itemview_update (); debug_end_measurement (DEBUG_GUI, "itemlist merge"); } debug_exit ("itemlist_merge_itemset"); }
void feedlist_mark_all_read (nodePtr node) { if (!node) return; feedlist_reset_new_item_count (); if (node != ROOTNODE) node_mark_all_read (node); else node_foreach_child (ROOTNODE, node_mark_all_read); feedlist_foreach (feedlist_update_node_counters); itemview_update_all_items (); itemview_update (); }
/** * To be called whenever an itemset was updated. If it is the * displayed itemset it will be merged against the item list * tree view. */ void itemlist_merge_itemset (itemSetPtr itemSet) { gint folder_display_mode; debug_enter ("itemlist_merge_itemset"); debug_start_measurement (DEBUG_GUI); /* No node check when loading search results directly */ if (!itemlist_priv.isSearchResult) { nodePtr node = node_from_id (itemSet->nodeId); if (!itemlist_priv.currentNode) return; /* Nothing to do if nothing is displayed */ if (!IS_VFOLDER (itemlist_priv.currentNode) && (itemlist_priv.currentNode != node) && !node_is_ancestor (itemlist_priv.currentNode, node)) return; /* Nothing to do if the item set does not belong to this node, or this is a search folder */ conf_get_int_value (FOLDER_DISPLAY_MODE, &folder_display_mode); if (IS_FOLDER (itemlist_priv.currentNode) && !folder_display_mode) return; /* Bail out if it is a folder without the recursive display preference set */ debug1 (DEBUG_GUI, "reloading item list with node \"%s\"", node_get_title (node)); } else { /* If we are loading a search result we must never merge anything besides the search items. In fact if we already have items we just return. */ if (itemlist_priv.searchResultComplete) return; itemlist_priv.searchResultComplete = TRUE; } /* merge items into item view */ itemset_foreach (itemSet, itemlist_merge_item); itemview_update (); debug_end_measurement (DEBUG_GUI, "itemlist merge"); debug_exit ("itemlist_merge_itemset"); }
static void on_htmlview_history_back (GtkWidget *widget, gpointer user_data) { LifereaHtmlView *htmlview = LIFEREA_HTMLVIEW (user_data); gchar *url; /* Going back is a bit more complex than forward as we want to switch from inline browsing back to headlines when we are in the item view. So we expect an URL or NULL for switching back to the headline */ url = browser_history_back (htmlview->priv->history); if (url) { gtk_widget_set_sensitive (htmlview->priv->forward, browser_history_can_go_forward (htmlview->priv->history)); gtk_widget_set_sensitive (htmlview->priv->back, browser_history_can_go_back (htmlview->priv->history)); liferea_htmlview_launch_URL_internal (htmlview, url); gtk_entry_set_text (GTK_ENTRY (htmlview->priv->urlentry), url); } else { gtk_widget_hide (htmlview->priv->toolbar); liferea_htmlview_clear (htmlview); itemview_update_all_items (); itemview_update (); } }
static void subscription_process_update_result (const struct updateResult * const result, gpointer user_data, guint32 flags) { subscriptionPtr subscription = (subscriptionPtr)user_data; nodePtr node = subscription->node; gboolean processing = FALSE; GTimeVal now; /* 1. preprocessing */ g_assert (subscription->updateJob); /* update the subscription URL on permanent redirects */ if ((301 == result->httpstatus) && result->source && !g_str_equal (result->source, subscription->updateJob->request->source)) { debug2 (DEBUG_UPDATE, "The URL of \"%s\" has changed permanently and was updated with \"%s\"", node_get_title(node), result->source); subscription_set_source (subscription, result->source); liferea_shell_set_status_bar (_("The URL of \"%s\" has changed permanently and was updated"), node_get_title(node)); } if (401 == result->httpstatus) { /* unauthorized */ auth_dialog_new (subscription, flags); } else if (410 == result->httpstatus) { /* gone */ subscription->discontinued = TRUE; node->available = TRUE; liferea_shell_set_status_bar (_("\"%s\" is discontinued. Liferea won't updated it anymore!"), node_get_title (node)); } else if (304 == result->httpstatus) { node->available = TRUE; liferea_shell_set_status_bar (_("\"%s\" has not changed since last update"), node_get_title(node)); } else { processing = TRUE; } subscription_update_error_status (subscription, result->httpstatus, result->returncode, result->filterErrors); subscription->updateJob = NULL; /* 2. call subscription type specific processing */ if (processing) SUBSCRIPTION_TYPE (subscription)->process_update_result (subscription, result, flags); /* 3. call favicon updating after subscription processing to ensure we have valid baseUrl for feed nodes... */ g_get_current_time (&now); if (favicon_update_needed (subscription->node->id, subscription->updateState, &now)) subscription_update_favicon (subscription); /* 4. generic postprocessing */ update_state_set_lastmodified (subscription->updateState, update_state_get_lastmodified (result->updateState)); update_state_set_cookies (subscription->updateState, update_state_get_cookies (result->updateState)); update_state_set_etag (subscription->updateState, update_state_get_etag (result->updateState)); g_get_current_time (&subscription->updateState->lastPoll); // FIXME: use new-items signal in itemview class itemview_update_node_info (subscription->node); itemview_update (); db_subscription_update (subscription); db_node_update (subscription->node); if (subscription->node->newCount > 0) feedlist_new_items (subscription->node); }