void feedlist_reset_new_item_count (void) { if (feedlist->priv->newCount) { feedlist->priv->newCount = 0; ui_tray_update (); liferea_shell_update_unread_stats (); } }
/* Called when the indicator container applet is hidden. */ static void on_indicator_interest_removed (IndicateServer *server, guint interest, gpointer user_data) { if (interest != INDICATE_INTEREST_SERVER_SIGNAL) return; indicator_priv->visible = FALSE; ui_tray_update (); }
static void feedlist_init (FeedList *fl) { gint startup_feed_action; debug_enter ("feedlist_init"); /* 1. Prepare globally accessible singleton */ g_assert (NULL == feedlist); feedlist = fl; feedlist->priv = FEEDLIST_GET_PRIVATE (fl); feedlist->priv->loading = TRUE; /* 2. Set up a root node and import the feed list source structure. */ debug0 (DEBUG_CACHE, "Setting up root node"); ROOTNODE = node_source_setup_root (); /* 3. Ensure folder expansion and unread count*/ debug0 (DEBUG_CACHE, "Initializing node state"); feedlist_foreach (feedlist_init_node); ui_tray_update (); /* 4. Check if feeds do need updating. */ debug0 (DEBUG_UPDATE, "Performing initial feed update"); conf_get_int_value (STARTUP_FEED_ACTION, &startup_feed_action); if (0 == startup_feed_action) { /* Update all feeds */ if (network_monitor_is_online ()) { debug0 (DEBUG_UPDATE, "initial update: updating all feeds"); node_update_subscription (feedlist_get_root (), GUINT_TO_POINTER (0)); } else { debug0 (DEBUG_UPDATE, "initial update: prevented because we are offline"); } } else { debug0 (DEBUG_UPDATE, "initial update: resetting feed counter"); feedlist_reset_update_counters (NULL); } /* 5. Start automatic updating */ feedlist->priv->autoUpdateTimer = g_timeout_add_seconds (10, feedlist_auto_update, NULL); g_signal_connect (network_monitor_get (), "online-status-changed", G_CALLBACK (on_network_status_changed), NULL); /* 6. Finally save the new feed list state */ feedlist->priv->loading = FALSE; feedlist_schedule_save (); debug_exit ("feedlist_init"); }
void feedlist_update_new_item_count (guint addValue) { feedlist->priv->newCount += addValue; /* On subsequent feed updates with cache drops more new items can be reported than effectively were merged. The simplest way to catch this case is by checking for new count > unread count here. */ if (feedlist->priv->newCount > ROOTNODE->unreadCount) feedlist->priv->newCount = ROOTNODE->unreadCount; ui_tray_update (); liferea_shell_update_unread_stats (); }