[nautilus-actions] Slight adjustments in na-pivot.{c,h} sources



commit 651f0ffe0261f7270a34cd247fe023e8b90155a2
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Jan 25 21:32:48 2010 +0100

    Slight adjustments in na-pivot.{c,h} sources

 ChangeLog                           |    3 +
 nautilus-actions/runtime/na-pivot.c |   72 +++++++++++++++++++---------------
 nautilus-actions/runtime/na-pivot.h |   10 ++++-
 3 files changed, 51 insertions(+), 34 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 309a80a..cac3d0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2009-01-25 Pierre Wieser <pwieser trychlos org>
 
 	* nautilus-actions/runtime/na-pivot.c:
+	* nautilus-actions/runtime/na-pivot.h: Source reorganization.
+
+	* nautilus-actions/runtime/na-pivot.c:
 	* nautilus-actions/runtime/na-pivot.h (na_pivot_get_automatic_reload):
 	Remove unused function.
 
diff --git a/nautilus-actions/runtime/na-pivot.c b/nautilus-actions/runtime/na-pivot.c
index 536eed1..a265482 100644
--- a/nautilus-actions/runtime/na-pivot.c
+++ b/nautilus-actions/runtime/na-pivot.c
@@ -68,8 +68,8 @@ struct NAPivotPrivate {
 	GList          *tree;
 
 	/* whether to automatically reload the whole configuration tree
-	 * when a modification has been detected in one of the underlying
-	 * I/O storage subsystems
+	 * when a modification is detected in one of the underlying I/O
+	 * storage subsystems
 	 * defaults to FALSE
 	 */
 	gboolean        automatic_reload;
@@ -84,6 +84,14 @@ struct NAPivotPrivate {
 	/* list of monitoring objects on runtime preferences
 	 */
 	GList          *monitors;
+
+	/* list of I/O providers
+	 * note that the N-A plugin is only interested about providers which are
+	 * present at runtime and should be read at startup, while the NACT user
+	 * interface wants all i/o providers, those available at runtime as well
+	 * as those described in preferences
+	 */
+	GList          *io_providers;
 };
 
 enum {
@@ -343,36 +351,6 @@ na_pivot_dump( const NAPivot *pivot )
 	}
 }
 
-/*
- * this handler is trigerred by IIOProviders when an action is changed
- * in the 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
- */
-void
-na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot  )
-{
-	static const gchar *thisfn = "na_pivot_item_changed_handler";
-
-	g_debug( "%s: provider=%p, id=%s, pivot=%p", thisfn, ( void * ) provider, id, ( void * ) pivot );
-
-	g_return_if_fail( NA_IS_IIO_PROVIDER( provider ));
-	g_return_if_fail( NA_IS_PIVOT( pivot ));
-
-	if( !pivot->private->dispose_has_run ){
-
-		/* set a timeout to notify clients at the end of the serie */
-		g_get_current_time( &pivot->private->last_event );
-
-		if( !pivot->private->event_source_id ){
-			pivot->private->event_source_id =
-				g_timeout_add( st_timeout_msec, ( GSourceFunc ) on_item_changed_timeout, pivot );
-		}
-	}
-}
-
 /**
  * na_pivot_get_providers:
  * @pivot: this #NAPivot instance.
@@ -420,6 +398,36 @@ na_pivot_free_providers( GList *providers )
 	na_module_free_extensions_list( providers );
 }
 
+/*
+ * this handler is trigerred by IIOProviders when an action is changed
+ * in the 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
+ */
+void
+na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot  )
+{
+	static const gchar *thisfn = "na_pivot_item_changed_handler";
+
+	g_debug( "%s: provider=%p, id=%s, pivot=%p", thisfn, ( void * ) provider, id, ( void * ) pivot );
+
+	g_return_if_fail( NA_IS_IIO_PROVIDER( provider ));
+	g_return_if_fail( NA_IS_PIVOT( pivot ));
+
+	if( !pivot->private->dispose_has_run ){
+
+		/* set a timeout to notify clients at the end of the serie */
+		g_get_current_time( &pivot->private->last_event );
+
+		if( !pivot->private->event_source_id ){
+			pivot->private->event_source_id =
+				g_timeout_add( st_timeout_msec, ( GSourceFunc ) on_item_changed_timeout, pivot );
+		}
+	}
+}
+
 /**
  * na_pivot_get_items:
  * @pivot: this #NAPivot instance.
diff --git a/nautilus-actions/runtime/na-pivot.h b/nautilus-actions/runtime/na-pivot.h
index 5a29e11..0652bca 100644
--- a/nautilus-actions/runtime/na-pivot.h
+++ b/nautilus-actions/runtime/na-pivot.h
@@ -124,11 +124,15 @@ typedef enum {
 NAPivot      *na_pivot_new( void );
 void          na_pivot_dump( const NAPivot *pivot );
 
-void          na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot );
-
+/* providers management of any NAIxxxxProvider interface
+ */
 GList        *na_pivot_get_providers( const NAPivot *pivot, GType type );
 void          na_pivot_free_providers( GList *providers );
 
+/* menus/actions items management
+ */
+void          na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot );
+
 GList        *na_pivot_get_items( const NAPivot *pivot );
 void          na_pivot_load_items( NAPivot *pivot );
 
@@ -139,6 +143,8 @@ void          na_pivot_remove_item( NAPivot *pivot, NAObject *item );
 guint         na_pivot_delete_item( const NAPivot *pivot, const NAObjectItem *item, GSList **messages );
 guint         na_pivot_write_item( const NAPivot *pivot, NAObjectItem *item, GSList **messages );
 
+/* NAIPivotConsumer interface management
+ */
 void          na_pivot_register_consumer( NAPivot *pivot, const NAIPivotConsumer *consumer );
 
 /* NAPivot properties and configuration



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