[evolution-data-server/dbus: 12/33] Remove EComponentListener



commit 49918f7831055d84182dd1deb0eddc1c23778509
Author: Ross Burton <ross linux intel com>
Date:   Mon Jun 1 14:46:38 2009 +0100

    Remove EComponentListener
---
 libedataserver/Makefile.am            |    2 -
 libedataserver/e-component-listener.c |  159 ---------------------------------
 libedataserver/e-component-listener.h |   47 ----------
 3 files changed, 0 insertions(+), 208 deletions(-)

diff --git a/libedataserver/Makefile.am b/libedataserver/Makefile.am
index c4a3db2..3cb916b 100644
--- a/libedataserver/Makefile.am
+++ b/libedataserver/Makefile.am
@@ -16,7 +16,6 @@ libedataserver_1_2_la_SOURCES =		\
 	e-account-list.c		\
 	e-account.c			\
 	e-categories.c			\
-	e-component-listener.c		\
 	e-flag.c			\
 	e-iconv.c			\
 	e-iterator.c			\
@@ -55,7 +54,6 @@ libedataserverinclude_HEADERS =		\
 	e-account-list.h		\
 	e-account.h			\
 	e-categories.h			\
-	e-component-listener.h		\
 	e-flag.h			\
 	e-iconv.h			\
 	e-iterator.h			\
diff --git a/libedataserver/e-component-listener.c b/libedataserver/e-component-listener.c
deleted file mode 100644
index f4b93e4..0000000
--- a/libedataserver/e-component-listener.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Component listener.
- *
- * Author:
- *   Rodrigo Moya <rodrigo ximian com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n-lib.h>
-#include <bonobo/bonobo-exception.h>
-#include <bonobo/bonobo-object.h>
-#include "e-component-listener.h"
-
-struct _EComponentListenerPrivate {
-	Bonobo_Unknown component;
-};
-
-static void e_component_listener_finalize   (GObject *object);
-
-static GList *watched_connections = NULL;
-static GStaticRecMutex watched_lock = G_STATIC_REC_MUTEX_INIT;
-
-enum {
-	COMPONENT_DIED,
-	LAST_SIGNAL
-};
-
-static guint comp_listener_signals[LAST_SIGNAL];
-
-static void
-connection_listen_cb (gpointer object, gpointer user_data)
-{
-	EComponentListener *cl;
-
-	g_static_rec_mutex_lock (&watched_lock);
-
-	cl = (EComponentListener *)user_data;
-	/* cl can be removed in e_component_listener_finalize */
-	if (g_list_find (watched_connections, cl) == NULL) {
-		g_static_rec_mutex_unlock (&watched_lock);
-		return;
-	}
-	switch (ORBit_small_get_connection_status (cl->priv->component)) {
-		case ORBIT_CONNECTION_DISCONNECTED :
-			watched_connections = g_list_remove (watched_connections, cl);
-
-			g_object_ref (cl);
-			g_signal_emit (cl, comp_listener_signals[COMPONENT_DIED], 0);
-			cl->priv->component = CORBA_OBJECT_NIL;
-			g_object_unref (cl);
-			break;
-		default :
-			break;
-	}
-
-	g_static_rec_mutex_unlock (&watched_lock);
-}
-
-G_DEFINE_TYPE (EComponentListener, e_component_listener, G_TYPE_OBJECT)
-
-static void
-e_component_listener_class_init (EComponentListenerClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
-	object_class->finalize = e_component_listener_finalize;
-	klass->component_died = NULL;
-
-	comp_listener_signals[COMPONENT_DIED] =
-		g_signal_new ("component_died",
-			      G_TYPE_FROM_CLASS (klass),
-			      G_SIGNAL_RUN_FIRST,
-			      G_STRUCT_OFFSET (EComponentListenerClass, component_died),
-			      NULL, NULL,
-			      g_cclosure_marshal_VOID__VOID,
-			      G_TYPE_NONE, 0);
-}
-
-static void
-e_component_listener_init (EComponentListener *cl)
-{
-	/* allocate internal structure */
-	cl->priv = g_new (EComponentListenerPrivate, 1);
-	cl->priv->component = CORBA_OBJECT_NIL;
-}
-
-static void
-e_component_listener_finalize (GObject *object)
-{
-	EComponentListener *cl = (EComponentListener *) object;
-
-	g_return_if_fail (E_IS_COMPONENT_LISTENER (cl));
-
-	g_static_rec_mutex_lock (&watched_lock);
-	watched_connections = g_list_remove (watched_connections, cl);
-	g_static_rec_mutex_unlock (&watched_lock);
-
-	if (cl->priv->component != CORBA_OBJECT_NIL)
-		cl->priv->component = CORBA_OBJECT_NIL;
-
-	/* free memory */
-	g_free (cl->priv);
-	cl->priv = NULL;
-
-	if (G_OBJECT_CLASS (e_component_listener_parent_class)->finalize)
-		(* G_OBJECT_CLASS (e_component_listener_parent_class)->finalize) (object);
-}
-
-/**
- * e_component_listener_new
- * @comp: Component to listen for.
- *
- * Create a new #EComponentListener object, which allows to listen
- * for a given component and get notified when that component dies.
- *
- * Returns: a component listener object.
- */
-EComponentListener *
-e_component_listener_new (Bonobo_Unknown comp)
-{
-	EComponentListener *cl;
-
-	g_return_val_if_fail (comp != NULL, NULL);
-
-	g_static_rec_mutex_lock (&watched_lock);
-
-	cl = g_object_new (E_COMPONENT_LISTENER_TYPE, NULL);
-	cl->priv->component = comp;
-
-	/* watch the connection */
-	ORBit_small_listen_for_broken (comp, G_CALLBACK (connection_listen_cb), cl);
-	watched_connections = g_list_prepend (watched_connections, cl);
-
-	g_static_rec_mutex_unlock (&watched_lock);
-
-	return cl;
-}
-
-Bonobo_Unknown
-e_component_listener_get_component (EComponentListener *cl)
-{
-	g_return_val_if_fail (E_IS_COMPONENT_LISTENER (cl), CORBA_OBJECT_NIL);
-	return cl->priv->component;
-}
-
-void
-e_component_listener_set_component (EComponentListener *cl, Bonobo_Unknown comp)
-{
-	g_return_if_fail (E_IS_COMPONENT_LISTENER (cl));
-
-	cl->priv->component = comp;
-	ORBit_small_listen_for_broken (comp, G_CALLBACK (connection_listen_cb), cl);
-}
diff --git a/libedataserver/e-component-listener.h b/libedataserver/e-component-listener.h
deleted file mode 100644
index ddce895..0000000
--- a/libedataserver/e-component-listener.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Component listener
- *
- * Author:
- *   Rodrigo Moya <rodrigo ximian com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- */
-
-#ifndef __E_COMPONENT_LISTENER_H__
-#define __E_COMPONENT_LISTENER_H__
-
-#include <glib-object.h>
-#include <bonobo/Bonobo.h>
-
-G_BEGIN_DECLS
-
-#define E_COMPONENT_LISTENER_TYPE        (e_component_listener_get_type ())
-#define E_COMPONENT_LISTENER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), E_COMPONENT_LISTENER_TYPE, EComponentListener))
-#define E_COMPONENT_LISTENER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), E_COMPONENT_LISTENER_TYPE, EComponentListenerClass))
-#define E_IS_COMPONENT_LISTENER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_COMPONENT_LISTENER_TYPE))
-#define E_IS_COMPONENT_LISTENER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_COMPONENT_LISTENER_TYPE))
-
-typedef struct _EComponentListenerPrivate EComponentListenerPrivate;
-
-typedef struct {
-	GObject object;
-	EComponentListenerPrivate *priv;
-} EComponentListener;
-
-typedef struct {
-	GObjectClass parent_class;
-
-	void (* component_died) (EComponentListener *cl);
-} EComponentListenerClass;
-
-GType               e_component_listener_get_type       (void);
-EComponentListener *e_component_listener_new            (Bonobo_Unknown comp);
-
-Bonobo_Unknown      e_component_listener_get_component  (EComponentListener *cl);
-void                e_component_listener_set_component  (EComponentListener *cl,
-							 Bonobo_Unknown comp);
-
-G_END_DECLS
-
-#endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]