Beispiel #1
0
RESULT ptrarray_remove()
{
	GPtrArray *array;
	guint i;
	
	array = ptrarray_alloc_and_fill(&i);

	g_ptr_array_remove(array, (gpointer)items[7]);

	if(!g_ptr_array_remove(array, (gpointer)items[4])) {
		return FAILED("Item %s not removed", items[4]);
	}

	if(g_ptr_array_remove(array, (gpointer)items[4])) {
		return FAILED("Item %s still in array after removal", items[4]);
	}

	if(array->pdata[array->len - 1] != items[array->len + 1]) {
		return FAILED("Last item in GPtrArray not correct");
	}

	g_ptr_array_free(array, TRUE);

	return OK;
}
Beispiel #2
0
/**
 * pka_manager_remove_channel:
 * @context: A #PkaContext.
 * @channel: A #PkaChannel.
 * @error: A location for a #GError, or %NULL.
 *
 * Removes @channel from the Perfkit Agent.  If the context does not have
 * permissions, the operation will fail.
 *
 * Returns: %TRUE if successful; otherwise %FALSE.
 * Side effects: None.
 */
gboolean
pka_manager_remove_channel (PkaContext  *context, /* IN */
                            PkaChannel  *channel, /* IN */
                            GError     **error)   /* OUT */
{
	gint channel_id;

	g_return_val_if_fail(context != NULL, FALSE);
	g_return_val_if_fail(PKA_IS_CHANNEL(channel), FALSE);

	ENTRY;
	AUTHORIZE_IOCTL(context, REMOVE_CHANNEL);
	/*
	 * TODO:
	 *
	 *   1) Ensure the channel is completely stopped.
	 *   2) Ensure the channels sources are stopped.
	 *   3) Notify the subscriptions the channel is gone.
	 *   4) Notify the listeners the subscription is gone.
	 *
	 */
	if (FALSE) {
		channel_id = pka_channel_get_id(channel);
		INFO(Channel, "Removing channel %d on behalf of context %d.",
		     channel_id, pka_context_get_id(context));
		G_LOCK(channels);
		g_ptr_array_remove(manager.channels, channel);
		G_UNLOCK(channels);
		NOTIFY_LISTENERS(channel_removed, channel_id);
		g_object_unref(channel);
	}
	RETURN(TRUE);
}
Beispiel #3
0
/**
 * pka_manager_remove_source:
 * @context: A #PkaContext.
 * @source: A #PkaSource.
 * @error: A location for a #GError, or %NULL.
 *
 * Removes @source from the Perfkit Agent.  If the context does not have
 * permissions, this operation will fail.
 *
 * Returns: %TRUE if successful; otherwise %FALSE.
 * Side effects: None.
 */
gboolean
pka_manager_remove_source (PkaContext  *context, /* IN */
                           PkaSource   *source,  /* IN */
                           GError     **error)   /* OUT */
{
	gboolean found;
	gint source_id;

	g_return_val_if_fail(context != NULL, FALSE);
	g_return_val_if_fail(PKA_IS_SOURCE(source), FALSE);

	ENTRY;
	AUTHORIZE_IOCTL(context, REMOVE_SOURCE);
	pka_source_notify_stopped(source);
	source_id = pka_source_get_id(source);
	INFO(Source, "Removing source %d on behalf of context %d.",
	     source_id, pka_context_get_id(context));
	G_LOCK(sources);
	found = g_ptr_array_remove(manager.sources, source);
	G_UNLOCK(sources);
	if (found) {
		NOTIFY_LISTENERS(source_removed, source_id);
		g_object_unref(source);
	}
	RETURN(found);
}
Beispiel #4
0
/**
 * pka_manager_remove_encoder:
 * @context: A #PkaContext.
 * @encoder: A #PkaEncoder.
 * @error: A location for a #GError, or %NULL.
 *
 * Removes @encoder from the Perfkit Agent.  If the context does not have
 * permissions, this operation will fail.
 *
 * Returns: %TRUE if succesful; otherwise %FALSE.
 * Side effects: None.
 */
gboolean
pka_manager_remove_encoder (PkaContext  *context, /* IN */
                            PkaEncoder  *encoder, /* IN */
                            GError     **error)   /* OUT */
{
	gint encoder_id;

	g_return_val_if_fail(context != NULL, FALSE);
	g_return_val_if_fail(PKA_IS_ENCODER(encoder), FALSE);

	ENTRY;
	AUTHORIZE_IOCTL(context, REMOVE_ENCODER);
	/*
	 * TODO:
	 *
	 *   1) Enure the encoder is not attached to a running channel.
	 *
	 */
	if (FALSE) {
		encoder_id = pka_encoder_get_id(encoder);
		INFO(Encoder, "Removing encoder %d on behalf of context %d.",
		     encoder_id, pka_context_get_id(context));
		G_LOCK(encoders);
		g_ptr_array_remove(manager.encoders, encoder);
		G_UNLOCK(encoders);
		NOTIFY_LISTENERS(encoder_removed, encoder_id);
		g_object_unref(encoder);
	}
	RETURN(TRUE);
}
Beispiel #5
0
void
mc_event_del (const gchar * event_group_name, const gchar * event_name,
              mc_event_callback_func_t event_callback, gpointer event_init_data)
{
    GTree *event_group;
    GPtrArray *callbacks;
    mc_event_callback_t *cb;

    if (mc_event_grouplist == NULL || event_group_name == NULL || event_name == NULL
        || event_callback == NULL)
        return;

    event_group = mc_event_get_event_group_by_name (event_group_name, FALSE, NULL);
    if (event_group == NULL)
        return;

    callbacks = mc_event_get_event_by_name (event_group, event_name, FALSE, NULL);
    if (callbacks == NULL)
        return;

    cb = mc_event_is_callback_in_array (callbacks, event_callback, event_init_data);

    if (cb == NULL)
        return;

    g_ptr_array_remove (callbacks, (gpointer) cb);
    g_free ((gpointer) cb);
}
Beispiel #6
0
/**
 * atk_relation_set_remove:
 * @set: an #AtkRelationSet
 * @relation: an #AtkRelation
 *
 * Removes a relation from the relation set.
 * This function unref's the #AtkRelation so it will be deleted unless there
 * is another reference to it.
 **/
void
atk_relation_set_remove (AtkRelationSet *set,
                         AtkRelation    *relation)
{
  GPtrArray *array_item;
  AtkRelationType relationship;

  g_return_if_fail (ATK_IS_RELATION_SET (set));

  array_item = set->relations;
  if (array_item == NULL)
    return;

  if (g_ptr_array_remove (array_item, relation))
  {
    g_object_unref (relation);
  }
  else
  {
    relationship = atk_relation_get_relation_type (relation);
    if (atk_relation_set_contains (set, relationship))
    {
      AtkRelation *exist_relation;
      gint i;
      exist_relation = atk_relation_set_get_relation_by_type (set, relationship);
      for (i = 0; i < relation->target->len; i++)
      {
        AtkObject *target = g_ptr_array_index(relation->target, i);
        atk_relation_remove_target (exist_relation, target);
      }
    }
  }
}
gboolean
my_timeline_model_remove_object (MyTimelineModel * self, gpointer object)
{
    MyTimelineModelPrivate *priv =
        my_timeline_model_get_instance_private (self);

    g_return_if_fail (MY_IS_TIMELINE_MODEL (self));

    if (MY_IS_SYSTEM (object)) {
    }
    else if (MY_IS_FLOW_ARROW (object)) {

        if (TIMELINE_MODEL_INDEX_IS_TRANSFER) {

            GPtrArray *transition;

            transition =
                g_ptr_array_index (priv->tl_arrows,
                                   TIMELINE_MODEL_CURRENT_INDEX);

            g_ptr_array_remove (transition, object);

            /*g_signal_emit (G_OBJECT (self), */
            /*signals[SIG_ARROW_REMOVED_AT_CURRENT_INDEX], 0, */
            /*object); */
        }
        else {
            g_print ("can't remove arrow in a state\n");
            return FALSE;
        }
    }

    return TRUE;
}
static void
mnp_clock_area_drop (MxDroppable *droppable, MxDraggable *draggable, gfloat event_x, gfloat event_y, gint button, ClutterModifierType modifiers)
{
  ClutterActor *self = CLUTTER_ACTOR (droppable);
  ClutterActor *child = CLUTTER_ACTOR (draggable);
  MnpClockTile *tile = (MnpClockTile *)draggable;
  MnpClockArea *area = (MnpClockArea *)droppable;
  GPtrArray *tiles = area->priv->clock_tiles;
  int i, pos;

  g_object_ref (draggable);

  pos = (event_y) / 80;
  if (pos >= tiles->len)
	  pos = tiles->len -1;
 
  clutter_actor_reparent (child, self);

  g_ptr_array_remove (tiles, (gpointer) draggable);
  insert_in_ptr_array (tiles, draggable, pos);

  clutter_actor_set_depth ((ClutterActor *)draggable, ((pos+1) * 0.05) - 0.01);
 
 
  for (i=tiles->len-1; i >= 0; i--) {
	  clutter_actor_set_depth (tiles->pdata[i], (i + 1) * 0.05);
  }
 
  area->priv->zone_reorder_func(mnp_clock_tile_get_location(tile), pos, area->priv->zone_reorder_data);

  g_object_unref (draggable);	
}
Beispiel #9
0
/**
 * Detaches track from the smf.
 */
void
smf_track_remove_from_smf(smf_track_t *track)
{
	int i, j;
	smf_track_t *tmp;
	smf_event_t *ev;

	assert(track->smf != NULL);

	track->smf->number_of_tracks--;

	assert(track->smf->tracks_array);
	g_ptr_array_remove(track->smf->tracks_array, track);

	/* Renumber the rest of the tracks, so they are consecutively numbered. */
	for (i = track->track_number; i <= track->smf->number_of_tracks; i++) {
		tmp = smf_get_track_by_number(track->smf, i);
		tmp->track_number = i;

		/*
		 * Events have track numbers too.  I guess this wasn't a wise
		 * decision.  ;-/
		 */
		for (j = 1; j <= tmp->number_of_events; j++) {
			ev = smf_track_get_event_by_number(tmp, j);
			ev->track_number = i;
		}
	}

	track->track_number = -1;
	track->smf = NULL;
}
static void
tile_drag_run (MnpClockTile *tile, int ypos, MnpClockArea *area)
{
  /*ClutterActor *self = CLUTTER_ACTOR (area);
  ClutterActor *child = CLUTTER_ACTOR (tile); */
  GPtrArray *tiles = area->priv->clock_tiles;
  int i, pos;
  int diff = tiles->len == 4 ? 80 : 110;
  g_object_ref (tile);

  pos = (ypos-diff) / 80;
  if (pos >= tiles->len)
	  pos = tiles->len -1;
 
  g_ptr_array_remove (tiles, (gpointer) tile);
  insert_in_ptr_array (tiles, tile, pos);

  clutter_actor_set_depth ((ClutterActor *)tile, ((pos+1) * 0.05) - 0.01);
 
 
  for (i=tiles->len-1; i >= 0; i--) {
	  clutter_actor_set_depth (tiles->pdata[i], (i + 1) * 0.05);
  }
 
  g_object_unref (tile);		
}
Beispiel #11
0
/*!
 * \brief Create a copy of the whole diagram data
 *
 * This is kind of a deep copy, everything not immutable gets duplicated.
 * Still this is supposed to be relatively fast, because the most expensive
 * objects have immutuable properties, namely the pixbufs in DiaImage are
 * only referenced.
 *
 * \memberof _DiagramData
 */
DiagramData *
diagram_data_clone (DiagramData *data)
{
  DiagramData *clone;
  guint i;
  
  clone = g_object_new (DIA_TYPE_DIAGRAM_DATA, NULL);
  
  clone->extents = data->extents;
  clone->bg_color = data->bg_color;
  clone->paper = data->paper; /* so ugly */
  clone->paper.name = g_strdup (data->paper.name);
  clone->is_compressed = data->is_compressed;
  
  layer_destroy(g_ptr_array_index(clone->layers, 0));
  g_ptr_array_remove(clone->layers, clone->active_layer);

  for (i=0; i < data->layers->len; ++i) {
    Layer *src_layer = g_ptr_array_index(data->layers, i);
    Layer *dest_layer = new_layer (layer_get_name (src_layer), clone);
  
    /* copy layer, init the active one */
    dest_layer->extents = src_layer->extents;
    dest_layer->objects = object_copy_list (src_layer->objects);
    dest_layer->visible = src_layer->visible;
    dest_layer->connectable = src_layer->connectable;
    g_ptr_array_add (clone->layers, dest_layer);
    if (src_layer == data->active_layer)
      clone->active_layer = dest_layer;
      
    /* the rest should be initialized by construction */
  }

  return clone;  
}
Beispiel #12
0
static gboolean
remove_color_to_names_sets (GstylePalette *self,
                            GstyleColor   *color)
{
  const gchar *name;
  GPtrArray *set;
  gboolean ret = FALSE;

  g_assert (GSTYLE_IS_PALETTE (self));
  g_assert (GSTYLE_IS_COLOR (color));

  name = gstyle_color_get_name (color);
  if (gstyle_str_empty0 (name))
    return FALSE;

  set = g_hash_table_lookup (self->color_names, name);
  if (set == NULL)
    return FALSE;

  ret = g_ptr_array_remove (set, color);
  if (set->len == 0)
    {
      g_ptr_array_unref (set);
      g_hash_table_remove (self->color_names, name);
    }

  return ret;
}
static void
access_point_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
{
	NMDeviceWifi *self = NM_DEVICE_WIFI (user_data);
	NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
	NMAccessPoint *ap;

	g_return_if_fail (self != NULL);

	ap = nm_device_wifi_get_access_point_by_path (self, path);
	if (ap) {
		if (ap == priv->active_ap) {
			g_object_unref (priv->active_ap);
			priv->active_ap = NULL;
			priv->null_active_ap = FALSE;

			_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
			priv->rate = 0;
			_nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_BITRATE);
		}

		g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
		g_ptr_array_remove (priv->aps, ap);
		g_object_unref (G_OBJECT (ap));
	}
}
static void
clean_up_aps (NMDeviceWifi *self, gboolean notify)
{
	NMDeviceWifiPrivate *priv;

	g_return_if_fail (NM_IS_DEVICE_WIFI (self));

	priv = NM_DEVICE_WIFI_GET_PRIVATE (self);

	if (priv->active_ap) {
		g_object_unref (priv->active_ap);
		priv->active_ap = NULL;
	}

	if (priv->aps) {
		while (priv->aps->len) {
			NMAccessPoint *ap = NM_ACCESS_POINT (g_ptr_array_index (priv->aps, 0));

			if (notify)
				g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
			g_ptr_array_remove (priv->aps, ap);
			g_object_unref (ap);
		}
		g_ptr_array_free (priv->aps, TRUE);
		priv->aps = NULL;
	}
}
Beispiel #15
0
static void pt_destroy (gpointer data, gboolean resident,
                        gpointer user_data)
{
/*   g_printerr ("%d: destroy 1 VsgVector3d (%p)\n", rk, data); */
  g_ptr_array_remove (points, data);
  g_free (data);
}
static void
clean_up_nsps (NMDeviceWimax *self, gboolean notify)
{
	NMDeviceWimaxPrivate *priv;

	g_return_if_fail (NM_IS_DEVICE_WIMAX (self));

	priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);

	if (priv->active_nsp) {
		g_object_unref (priv->active_nsp);
		priv->active_nsp = NULL;
	}

	if (priv->nsps) {
		while (priv->nsps->len) {
			NMWimaxNsp *nsp = NM_WIMAX_NSP (g_ptr_array_index (priv->nsps, 0));

			if (notify)
				g_signal_emit (self, signals[NSP_REMOVED], 0, nsp);
			g_ptr_array_remove (priv->nsps, nsp);
			g_object_unref (nsp);
		}
		g_ptr_array_free (priv->nsps, TRUE);
		priv->nsps = NULL;
	}
}
static gboolean on_close_button_clicked(GtkWidget* widget,
               GdkEvent* event, gpointer data)
{
    meta_verbose("%s\n", __func__);
    DeepinWorkspaceOverview* self = (DeepinWorkspaceOverview*)data;
    DeepinWorkspaceOverviewPrivate* priv = self->priv;

    if (!priv->ready) return FALSE;

    MetaWindow* meta_window = meta_deepin_cloned_widget_get_window(priv->hovered_clone);
    for (int i = 0; i < priv->monitors->len; i++) {
        MonitorData* md = (MonitorData*)g_ptr_array_index(priv->monitors, i);
        if (!md->clones) continue;

        for (gint i = 0; i < md->clones->len; i++) {
            MetaDeepinClonedWidget* clone = g_ptr_array_index(md->clones, i);
            if (clone == priv->hovered_clone) {
                g_ptr_array_remove(md->clones, clone);
                gtk_container_remove(GTK_CONTAINER(self), clone);
                meta_window_delete(meta_window, CurrentTime);

                priv->hovered_clone = NULL;
                _hide_close_button(self);

                g_idle_add((GSourceFunc)on_idle, self);
                return TRUE;
            }
        }
    }


    return TRUE;
}
static void on_window_removed(DeepinMessageHub* hub, MetaWindow* window, 
        gpointer data)
{
    DeepinWorkspaceOverview* self = DEEPIN_WORKSPACE_OVERVIEW(data);
    DeepinWorkspaceOverviewPrivate* priv = self->priv;

    for (int i = 0; i < priv->monitors->len; i++) {
        MonitorData* md = (MonitorData*)g_ptr_array_index(priv->monitors, i);
        if (!md->clones) continue;

        for (gint i = 0; i < md->clones->len; i++) {
            MetaDeepinClonedWidget* clone = g_ptr_array_index(md->clones, i);
            if (meta_deepin_cloned_widget_get_window(clone) == window) {
                g_ptr_array_remove(md->clones, clone);
                gtk_container_remove(GTK_CONTAINER(self), (GtkWidget*)clone);

                meta_verbose("%s remove clone for %s\n", __func__, window->desc);

                if (priv->hovered_clone == clone) {
                    priv->hovered_clone = NULL;
                    _hide_close_button(self);
                }

                if (priv->ready) g_idle_add((GSourceFunc)on_idle, self);

                return;
            }
        }
    }
}
Beispiel #19
0
void pt_destroy (gpointer data, gboolean resident, gpointer array)
{
  if (resident)
    g_ptr_array_remove ((GPtrArray *) array, data);

  g_free (data);
}
Beispiel #20
0
int 
lcm_unsubscribe (lcm_t *lcm, lcm_subscription_t *h)
{
    g_static_rec_mutex_lock (&lcm->mutex);

    // remove the handler from the master list
    int foundit = g_ptr_array_remove(lcm->handlers_all, h);

    if (lcm->provider && lcm->vtable->unsubscribe) {
        lcm->vtable->unsubscribe(lcm->provider, h->channel);
    }

    if (foundit) {
        // remove the handler from all the lists in the hash table
        g_hash_table_foreach(lcm->handlers_map, map_remove_handler_callback, h);
        if (!h->callback_scheduled)
            lcm_handler_free (h);
        else
            h->marked_for_deletion = 1;
    }

    g_static_rec_mutex_unlock (&lcm->mutex);

    return foundit ? 0 : -1;
}
Beispiel #21
0
int PreloadChannelDtor(struct ChannelDesc *channel, int n)
{
  int code = 0;
  int handle;

  assert(channel != NULL);
  assert(n < channel->source->len);

  /* adjust the size of writable channels */
  handle = GPOINTER_TO_INT(CH_HANDLE(channel, n));
  if(channel->limits[PutSizeLimit] && channel->limits[PutsLimit]
     && CH_PROTO(channel, n) == ProtoRegular)
    code = ftruncate(handle, channel->size);

  ZLOGS(LOG_DEBUG,
      "%s closed with getsize = %ld, putsize = %ld", channel->alias,
      channel->counters[GetSizeLimit], channel->counters[PutSizeLimit]);

  if(handle != 0)
  {
    if(CH_PROTO(channel, n) == ProtoRegular)
      close(handle);
    else
      fclose(CH_HANDLE(channel, n));
  }

  g_ptr_array_remove(channel->source, CH_FILE(channel, n));
  return -(code != 0);
}
static void
mnp_clock_tile_removed (MnpClockTile *tile, MnpClockArea *area)
{
	g_ptr_array_remove (area->priv->clock_tiles, tile);	
	
	area->priv->zone_remove_func (area, mnp_clock_tile_get_location(tile)->display, area->priv->zone_remove_data);
}
static void
on_content_removed_cb (TpProxy *proxy,
    const gchar *content_path,
    gpointer user_data,
    GObject *weak_object)
{
  TpyCallChannel *self = TPY_CALL_CHANNEL (proxy);
  TpyCallContent *content = NULL, *c;
  guint i;

  DEBUG ("Content removed: %s", content_path);

  for (i = 0; i < self->priv->contents->len; i++)
    {
      c = g_ptr_array_index (self->priv->contents, i);
      if (g_strcmp0 (tp_proxy_get_object_path (c), content_path) == 0)
        {
          content = c;
          break;
        }
    }

  if (content != NULL)
    {
      g_signal_emit (self, _signals[CONTENT_REMOVED], 0, content);
      g_ptr_array_remove (self->priv->contents, content);
    }
  else
    {
      g_warning ("The removed content '%s' isn't in the call!", content_path);
    }
}
static void
update_failures (EmpathyWebcredentialsMonitor *self)
{
    GVariant *failures, *f;
    GVariantIter iter;
    GList *new_list = NULL;
    guint i;

    failures = g_dbus_proxy_get_cached_property (self->priv->proxy,
               FAILURES_PROP);
    if (failures == NULL)
    {
        g_debug ("Does not implement Failures property");
        return;
    }

    g_variant_iter_init (&iter, failures);
    while ((f = g_variant_iter_next_value (&iter)) != NULL)
    {
        guint32 id;
        AgAccount *account;

        id = g_variant_get_uint32 (f);

        account = ag_manager_get_account (self->priv->manager, id);
        if (account == NULL)
            continue;

        /* Pass ownership of 'account' to the list */
        new_list = g_list_append (new_list, account);

        if (!tp_g_ptr_array_contains (self->priv->failures, account))
        {
            g_ptr_array_add (self->priv->failures, g_object_ref (account));

            g_signal_emit (self, signals[SIG_FAILURE_ADDED], 0, account);
        }

        g_variant_unref (f);
    }

    g_variant_unref (failures);

    for (i = 0; i < self->priv->failures->len; i++)
    {
        AgAccount *account = g_ptr_array_index (self->priv->failures, i);

        if (g_list_find (new_list, account) == NULL)
        {
            g_object_ref (account);
            g_ptr_array_remove (self->priv->failures, account);

            g_signal_emit (self, signals[SIG_FAILURE_REMOVED], 0, account);
            g_object_unref (account);
        }
    }

    g_list_free_full (new_list, g_object_unref);
}
void pt_destroy (Pt *data, gboolean resident,
                 gpointer user_data)
{
  if (resident)
    g_ptr_array_remove (points, data);

  g_free (data);
}
Beispiel #26
0
static void rg_destroy (gpointer data, gboolean resident,
                        gpointer user_data)
{
/*   g_printerr ("%d: destroy 1 Sphere (%p)\n", rk, data); */

  g_ptr_array_remove (regions, data);
  g_free (data);
}
static void remmina_widget_pool_on_widget_destroy(GtkWidget *widget, gpointer data)
{
	g_ptr_array_remove(remmina_widget_pool, widget);
	if (remmina_widget_pool->len == 0 && remmina_widget_pool_try_quit_handler == 0)
	{
		/* Wait for a while to make sure no more windows will open before we quit the application */
		remmina_widget_pool_try_quit_handler = g_timeout_add(10000, remmina_widget_pool_try_quit, NULL);
	}
}
static void
_recipients_button_remove_clicked(void *data, Evas_Object *obj, void *event_info)
{
	(void) obj;
	(void) event_info;
	struct _recipient_pack *pack = (struct _recipient_pack *)data;
	g_ptr_array_remove(pack->view->recipients, pack->recipient);
	elm_object_item_del(pack->glit);
}
Beispiel #29
0
gboolean
af_animator_remove_transition (guint         id,
		               AfTransition *transition)
{
  AfAnimator *animator;

  g_return_val_if_fail (animators != NULL, FALSE);
  g_return_val_if_fail (transition != NULL, FALSE);

  animator = g_hash_table_lookup (animators, GUINT_TO_POINTER (id));

  g_return_val_if_fail (animator != NULL, FALSE);

  if (g_ptr_array_remove (animator->transitions, transition) == FALSE)
    return g_ptr_array_remove (animator->finished_transitions, transition);

  return TRUE;
}
static void roomlist_channel_closed_cb (KindlingRoomlistChannel *channel, gpointer user_data) {
	KindlingRoomlistManager *self = KINDLING_ROOMLIST_MANAGER(user_data);
	KindlingRoomlistManagerPrivate *priv = KINDLING_ROOMLIST_MANAGER_GET_PRIVATE(self);
	tp_channel_manager_emit_channel_closed_for_object (self, TP_EXPORTABLE_CHANNEL(channel));
	if (priv->channels != NULL) {
		g_ptr_array_remove (priv->channels, channel);
		g_object_unref (channel);
	}
}