~desrt/indicator-appmenu/hud-rewrite-wip

« back to all changes in this revision

Viewing changes to src/hudsourcelist.c

  • Committer: Ryan Lortie
  • Date: 2012-03-15 18:25:50 UTC
  • Revision ID: desrt@desrt.ca-20120315182550-vafhb1snbn5hxigs
hud-service: hudsource: add a concept of "use count"

Add hud_source_use() and hud_source_unuse() to indicate to a HudSource
that an active query is being performed against it.

This is wired up all the way through to the level of the collectors but
it does not yet do anything there.  Stay tuned.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
}
64
64
 
65
65
static void
 
66
hud_source_list_use (HudSource *source)
 
67
{
 
68
  HudSourceList *list = HUD_SOURCE_LIST (source);
 
69
  GSList *node;
 
70
 
 
71
  for (node = list->list; node; node = node->next)
 
72
    hud_source_use (node->data);
 
73
}
 
74
 
 
75
static void
 
76
hud_source_list_unuse (HudSource *source)
 
77
{
 
78
  HudSourceList *list = HUD_SOURCE_LIST (source);
 
79
  GSList *node;
 
80
 
 
81
  for (node = list->list; node; node = node->next)
 
82
    hud_source_unuse (node->data);
 
83
}
 
84
 
 
85
static void
66
86
hud_source_list_search (HudSource   *source,
67
87
                        GPtrArray   *results_array,
68
88
                        const gchar *search_string)
94
114
static void
95
115
hud_source_list_iface_init (HudSourceInterface *iface)
96
116
{
 
117
  iface->use = hud_source_list_use;
 
118
  iface->unuse = hud_source_list_unuse;
97
119
  iface->search = hud_source_list_search;
98
120
}
99
121