[nautilus-actions] Remove IIO_PROVIDER_SIGNAL_ITEM_CHANGED signal definition from public API



commit 7ca19b1bc48e927d08e9b462c846a26bf4fdaa79
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Jan 10 20:45:15 2011 +0100

    Remove IIO_PROVIDER_SIGNAL_ITEM_CHANGED signal definition from public API
    
    The signal is moved to internal (private) API, and renamed accordingly.

 ChangeLog                  |    9 +++++++++
 src/api/na-iio-provider.h  |    5 -----
 src/core/na-iio-provider.c |   35 ++++++++++++++++++++---------------
 src/core/na-io-provider.c  |    2 +-
 src/core/na-io-provider.h  |   18 ++++++++++++------
 src/core/na-pivot.c        |    9 ++++++---
 6 files changed, 48 insertions(+), 30 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1069292..95b4925 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,15 @@
 
 2011-01-10 Pierre Wieser <pwieser trychlos org>
 
+	* src/api/na-iio-provider.h:
+	* src/core/na-io-provider.h: IIO_PROVIDER_SIGNAL_ITEM_CHANGED signal
+	definition is moved (and renamed) from public API to internal one.
+
+	* src/core/na-iio-provider.c (interface_base_init):
+	* src/core/na-io-provider.c (io_provider_set_provider):
+	* src/core/na-pivot.c (on_item_changed_timeout): Updated accordingly.
+
+	* src/core/na-iio-provider.c
 	* src/core/na-settings.c (na_settings_new):
 	* src/utils/na-gconf2key.sh.in: Global configuration file goes to /etc/xdg.
 
diff --git a/src/api/na-iio-provider.h b/src/api/na-iio-provider.h
index b9621a9..de8022a 100644
--- a/src/api/na-iio-provider.h
+++ b/src/api/na-iio-provider.h
@@ -322,11 +322,6 @@ GType na_iio_provider_get_type( void );
  */
 void  na_iio_provider_item_changed ( const NAIIOProvider *instance );
 
-/* signal sent from a NAIIOProvider
- * via the na_iio_provider_item_changed() function
- */
-#define IIO_PROVIDER_SIGNAL_ITEM_CHANGED	"notify-pivot"
-
 /* Adding a new status here should imply also adding a new tooltip
  * in #na_io_provider_get_readonly_tooltip().
  */
diff --git a/src/core/na-iio-provider.c b/src/core/na-iio-provider.c
index 982d6d8..da84af6 100644
--- a/src/core/na-iio-provider.c
+++ b/src/core/na-iio-provider.c
@@ -34,6 +34,8 @@
 
 #include <api/na-iio-provider.h>
 
+#include "na-io-provider.h"
+
 /* private interface data
  */
 struct _NAIIOProviderInterfacePrivate {
@@ -127,8 +129,8 @@ interface_base_init( NAIIOProviderInterface *klass )
 		klass->delete_item = NULL;
 		klass->duplicate_data = NULL;
 
-		/**
-		 * NAIIOProvider::notify-pivot:
+		/*
+		 * NAIOProvider::io-provider-item-changed:
 		 * @provider: the #NAIIOProvider which has called the
 		 *  na_iio_provider_item_changed() function.
 		 * @arg1: not used, initialized to %NULL.
@@ -138,15 +140,15 @@ interface_base_init( NAIIOProviderInterface *klass )
 		 * function.
 		 *
 		 * The signal is registered without any default handler.
-		 * Only NAPivot object is connected to it.
+		 * Typically, only NAPivot object is connected to it.
 		 */
 		st_signals[ ITEM_CHANGED ] = g_signal_new(
-					IIO_PROVIDER_SIGNAL_ITEM_CHANGED,
+					IO_PROVIDER_SIGNAL_ITEM_CHANGED,
 					NA_IIO_PROVIDER_TYPE,
-					G_SIGNAL_RUN_LAST,
-					0,
-					NULL,
-					NULL,
+					G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+					0,									/* class offset */
+					NULL,								/* accumulator */
+					NULL,								/* accumulator data */
 					g_cclosure_marshal_VOID__POINTER,
 					G_TYPE_NONE,
 					1,
@@ -191,13 +193,16 @@ do_is_able_to_write( const NAIIOProvider *instance )
  * detected a modification in one of its items (menu or action).
  *
  * This function may be triggered for each and every
- * #NAObjectItem -derived modified objects, and, at least, once
- * for a coherent set of updates.
+ * #NAObjectItem -derived modified objects, and should, at least, be
+ * triggered once for a coherent set of updates.
+ *
+ * When receiving this signal, the currently running program may ask for
+ * reload the current list of items, menus and actions; it may also choose
+ * to ask the user if he is willing to reload such a current list.
  *
- * When receiving this signal, the current &prodname; program will
- * automatically ask its I/O providers for a current list of menus and
- * actions, or ask the user if he is willing to reload such a current
- * list, depending of the exact running &prodname; program.
+ * Note that NAPivot pivot is typically the only object connected to this
+ * signal. It acts so as a filtering proxy, re-emitting its own 'items-changed'
+ * signal for a whole set of detected underlying modifications.
  *
  * Since: 2.30
  */
@@ -208,5 +213,5 @@ na_iio_provider_item_changed( const NAIIOProvider *instance )
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
 
-	g_signal_emit_by_name(( gpointer ) instance, IIO_PROVIDER_SIGNAL_ITEM_CHANGED, NULL );
+	g_signal_emit_by_name(( gpointer ) instance, IO_PROVIDER_SIGNAL_ITEM_CHANGED, NULL );
 }
diff --git a/src/core/na-io-provider.c b/src/core/na-io-provider.c
index 957e79f..57fa4ed 100644
--- a/src/core/na-io-provider.c
+++ b/src/core/na-io-provider.c
@@ -463,7 +463,7 @@ io_provider_set_provider( NAIOProvider *provider, NAIIOProvider *instance, const
 	provider->private->item_changed_handler =
 			g_signal_connect(
 					instance,
-					IIO_PROVIDER_SIGNAL_ITEM_CHANGED,
+					IO_PROVIDER_SIGNAL_ITEM_CHANGED,
 					( GCallback ) na_pivot_item_changed_handler,
 					( gpointer ) pivot );
 }
diff --git a/src/core/na-io-provider.h b/src/core/na-io-provider.h
index 88c48ed..3e10e52 100644
--- a/src/core/na-io-provider.h
+++ b/src/core/na-io-provider.h
@@ -35,8 +35,9 @@
  * @short_description: The #NAIOProvider Class Definition.
  * @include: core/na-io-provider.h
  *
- * NAIOProvider is the Nautilus-Actions class which is used to manage
- * external I/O Providers which implement #NAIIOProvider interface.
+ * #NAIOProvider is the Nautilus-Actions class which is used to manage
+ * external I/O Providers which implement #NAIIOProvider interface. Each
+ * #NAIOProvider objects encapsulates one #NAIIOProvider provider.
  *
  * Internal Nautilus-Actions code should never directly call a
  * #NAIIOProvider interface method, but rather should call the
@@ -75,10 +76,15 @@ typedef struct {
 
 /* GConf preferences key
  */
-#define IO_PROVIDER_KEY_ROOT			"io-providers"
-#define IO_PROVIDER_KEY_READABLE		"read-at-startup"
-#define IO_PROVIDER_KEY_WRITABLE		"writable"
-#define IO_PROVIDER_KEY_ORDER			"io-providers-order"
+#define IO_PROVIDER_KEY_ROOT				"io-providers"
+#define IO_PROVIDER_KEY_READABLE			"read-at-startup"
+#define IO_PROVIDER_KEY_WRITABLE			"writable"
+#define IO_PROVIDER_KEY_ORDER				"io-providers-order"
+
+/* signal sent from a NAIIOProvider
+ * via the na_iio_provider_item_changed() function
+ */
+#define IO_PROVIDER_SIGNAL_ITEM_CHANGED		"io-provider-item-changed"
 
 GType          na_io_provider_get_type ( void );
 
diff --git a/src/core/na-pivot.c b/src/core/na-pivot.c
index fc6c5e3..ef11a6d 100644
--- a/src/core/na-pivot.c
+++ b/src/core/na-pivot.c
@@ -603,10 +603,11 @@ na_pivot_set_new_items( NAPivot *pivot, GList *items )
  * na_pivot_item_changed_handler:
  * @provider: the #NAIIOProvider which has emitted the signal.
  * @id: the id of the changed #NAObjectItem-derived object.
+ *  As of 2.30, it is always %NULL.
  * @pivot: this #NAPivot instance.
  *
- * This handler is trigerred by IIOProviders when an action is changed
- * in their underlying storage subsystems.
+ * This handler is trigerred by #NAIIOProvider providers when an action
+ * is changed in their underlying storage subsystems.
  * We don't care of updating our internal list with each and every
  * atomic modification; instead we wait for the end of notifications
  * serie, and then reload the whole list of actions
@@ -658,7 +659,9 @@ on_item_changed_timeout( NAPivot *pivot )
 	}
 
 	/* last individual notification is older that the st_burst_timeout
-	 * so triggers the NAIIOProvider interface and destroys this timeout
+	 * we may so suppose that the burst is terminated
+	 * this is up to NAPivot to send now its summarized signal
+	 * last, destroy this timeout
 	 */
 	g_debug( "%s: triggering NAIPivotConsumer interfaces", thisfn );
 



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