Пример #1
0
gchar *links_catalog_dump(void)
{
  gchar *msg;

  msg = g_strdup("");
  links_catalog_foreach(link_dump_tvs, &msg);
  return msg;
}
Пример #2
0
/* Calls update_link for every link. This is actually a function that
 shouldn't be called often, because it might take a very long time 
 to complete */
void
links_catalog_update_all(void)
{
  GList *delete_list = NULL;

  if (!all_links)
    return;

  /* we can't delete links while traversing the catalog, so while updating links
   * we fill a list with the expired link_id's */
  links_catalog_foreach((GTraverseFunc) update_link, &delete_list);

  /* after, remove all links on the list from catalog 
   * WARNING: after this call, the list items are also destroyed */
  g_list_foreach(delete_list, gfunc_remove_link, NULL);
  
  /* free the list - list items are already destroyed */
  g_list_free(delete_list);

  g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
         _("Updated links. Active links %d"), links_catalog_size());
}
Пример #3
0
static void
diagram_update_links(GtkWidget * canvas)
{
  GList *delete_list = NULL;

  /* Delete old capture links and update capture link variables */
  links_catalog_update_all();

  /* Check if there are any new links */
  links_catalog_foreach((GTraverseFunc) check_new_link, canvas);

  /* Update links look 
   * We also queue timedout links for deletion */
  delete_list = NULL;
  g_tree_foreach(canvas_links,
                   (GTraverseFunc) canvas_link_update,
                   &delete_list);

  /* delete all canvas links queued */
  g_list_foreach(delete_list, gfunc_remove_canvas_link, NULL);

  /* free the list - list items are already destroyed */
  g_list_free(delete_list);
}