~canonical-dx-team/unity/unity.fix-ql-losing-focus

« back to all changes in this revision

Viewing changes to libunity/ubus-server.c

  • Committer: Michael Terry
  • Date: 2010-12-17 14:07:11 UTC
  • mfrom: (724 unity)
  • mto: This revision was merged to the branch mainline in revision 743.
  • Revision ID: mike@mterry.name-20101217140711-qlij3bxdjuq1xoph
mergeĀ fromĀ upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
ubus_message_info_new (GVariant *data)
107
107
{
108
108
  UBusMessageInfo *info;
109
 
  
 
109
 
110
110
  info = g_slice_new (UBusMessageInfo);
111
111
  info->data = data;
112
112
 
113
113
  if (data != NULL)
114
114
    g_variant_ref_sink (data);
115
 
  
 
115
 
116
116
  return info;
117
117
}
118
118
 
121
121
{
122
122
  if (info->data != NULL)
123
123
    g_variant_unref (info->data);
124
 
  
 
124
 
125
125
  g_slice_free (UBusMessageInfo, info);
126
126
}
127
127
 
129
129
ubus_server_init (UBusServer *server)
130
130
{
131
131
  UBusServerPrivate *priv;
132
 
  
 
132
 
133
133
  priv = server->priv = UBUS_SERVER_GET_PRIVATE (server);
134
134
 
135
135
  /* message_interest_table holds the message/DispatchInfo relationship
159
159
{
160
160
  UBusServer        *server;
161
161
  UBusServerPrivate *priv;
162
 
  
 
162
 
163
163
  server = UBUS_SERVER (object);
164
164
  priv = server->priv;
165
 
  
 
165
 
166
166
  g_hash_table_destroy (priv->message_interest_table);
167
167
  g_hash_table_destroy (priv->dispatch_table);
168
168
 
191
191
{
192
192
  UBusServer *server;
193
193
  static gsize singleton;
194
 
  
 
194
 
195
195
  if (g_once_init_enter (&singleton))
196
 
    {      
 
196
    {
197
197
      server = g_object_new (UBUS_TYPE_SERVER, NULL);
198
198
      g_object_ref_sink (server);
199
199
      g_once_init_leave (&singleton, (gsize) server);
250
250
  UBusServerPrivate *priv = server->priv;
251
251
  UBusMessageInfo *info;
252
252
 
253
 
  priv->message_pump_queued = TRUE;
 
253
  priv->message_pump_queued = FALSE;
254
254
 
255
255
  // loop through each message queued and call the dispatch functions associated
256
256
  // with it. something in the back of my mind says it would be quicker in some
257
257
  // situations to sort the queue first so that duplicate messages can re-use
258
258
  // the same dispatch_list lookups.. but thats a specific case.
259
259
 
260
 
 
261
260
  info = g_queue_pop_tail (priv->message_queue);
262
261
  for (; info != NULL; info = g_queue_pop_tail (priv->message_queue))
263
262
    {
266
265
                                           info->message);
267
266
 
268
267
      if (dispatch_list == NULL)
269
 
        continue; // no handlers for this message
 
268
        {
 
269
          continue; // no handlers for this message
 
270
        }
270
271
 
271
272
      GSequenceIter *iter = g_sequence_get_begin_iter (dispatch_list);
272
273
      GSequenceIter *end = g_sequence_get_end_iter (dispatch_list);
292
293
ubus_server_queue_message_pump (UBusServer *server)
293
294
{
294
295
  UBusServerPrivate *priv;
295
 
  
 
296
 
296
297
  g_return_if_fail (UBUS_IS_SERVER (server));
297
298
 
298
299
  priv = server->priv;
310
311
{
311
312
  UBusServerPrivate *priv;
312
313
  UBusMessageInfo   *message_info;
313
 
  
 
314
 
314
315
  g_return_if_fail (UBUS_IS_SERVER (server));
315
 
  g_return_if_fail (message != NULL);  
 
316
  g_return_if_fail (message != NULL);
316
317
 
317
318
  priv = server->priv;
318
319
  message_info = ubus_message_info_new (data);
329
330
  UBusServerPrivate *priv;
330
331
  GSequence         *dispatch_list;
331
332
  UBusDispatchInfo  *info;
332
 
  
 
333
 
333
334
  g_return_if_fail (UBUS_IS_SERVER (server));
334
335
  g_return_if_fail (handle > 0);
335
336
 
336
 
  priv = server->priv;  
 
337
  priv = server->priv;
337
338
  info = g_hash_table_lookup (priv->dispatch_table, GUINT_TO_POINTER (handle));
338
339
 
339
340
  if (info == NULL)