Exemple #1
0
/* load holder's data into dashboard */
void
load_data_to_dash (GHolder * h, GDash * dash, GModule module,
                   GScrolling * scrolling)
{
   int alloc_size = 0;
   int i, j;

   alloc_size = dash->module[module].alloc_data;
   if (scrolling->expanded && module == scrolling->current) {
      if (module == OS || module == BROWSERS || module == HOSTS)
         alloc_size += h->sub_items_size;
   }
   dash->module[module].alloc_data = alloc_size;
   dash->module[module].data = new_gdata (alloc_size);
   dash->module[module].holder_size = h->holder_size;

   for (i = 0, j = 0; i < alloc_size; i++) {
      if (j < dash->module[module].ht_size && h->items[j].data != NULL) {
         add_item_to_dash (&dash, h->items[j], module);
         if (scrolling->expanded && module == scrolling->current) {
            if (module == OS || module == BROWSERS || module == HOSTS ||
                module == STATUS_CODES)
               add_sub_item_to_dash (&dash, h->items[j], module, &i);
         }
         j++;
      }
   }
}
Exemple #2
0
/* load holder's data into dashboard */
void
load_data_to_dash (GHolder * h, GDash * dash, GModule module, GScroll * gscroll)
{
  int alloc_size = 0;
  int i, j;

  alloc_size = dash->module[module].alloc_data;
  if (gscroll->expanded && module == gscroll->current)
    alloc_size += h->sub_items_size;

  dash->module[module].alloc_data = alloc_size;
  dash->module[module].data = new_gdata (alloc_size);
  dash->module[module].holder_size = h->holder_size;

  for (i = 0, j = 0; i < alloc_size; i++) {
    if (h->items[j].metrics->data == NULL)
      continue;

    add_item_to_dash (&dash, h->items[j], module);
    if (gscroll->expanded && module == gscroll->current && h->sub_items_size)
      add_sub_item_to_dash (&dash, h->items[j], module, &i);
    j++;
  }
}