[nautilus-actions] Refactoring: update src/core/na-ipivot-consumer.{c, h}



commit d49987348b74dbfe9f2128724cf323d4d3708e4d
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Feb 15 20:17:35 2010 +0100

    Refactoring: update src/core/na-ipivot-consumer.{c,h}

 ChangeLog                     |    1 +
 src/core/na-ipivot-consumer.c |   32 ++++++++++++++++----------------
 src/core/na-ipivot-consumer.h |   20 ++++++++++----------
 3 files changed, 27 insertions(+), 26 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 317b14e..818e4fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-02-15 Pierre Wieser <pwieser trychlos org>
 
+	Update src/core/na-ipivot-consumer.{c,h}
 	Update src/core/na-io-factory.{c,h}
 	Update src/core/na-io-provider.{c,h}
 	Update src/core/na-iabout.{c,h}
diff --git a/src/core/na-ipivot-consumer.c b/src/core/na-ipivot-consumer.c
index b8827e1..241094e 100644
--- a/src/core/na-ipivot-consumer.c
+++ b/src/core/na-ipivot-consumer.c
@@ -99,11 +99,11 @@ interface_base_init( NAIPivotConsumerInterface *klass )
 	static const gchar *thisfn = "na_ipivot_consumer_interface_base_init";
 
 	if( !st_initialized ){
-		g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
+		g_debug( "%s: klass=%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass ));
 
 		klass->private = g_new0( NAIPivotConsumerInterfacePrivate, 1 );
 
-		klass->on_actions_changed = NULL;
+		klass->on_items_changed = NULL;
 		klass->on_create_root_menu_changed = NULL;
 		klass->on_display_about_changed = NULL;
 		klass->on_display_order_changed = NULL;
@@ -117,12 +117,12 @@ interface_base_finalize( NAIPivotConsumerInterface *klass )
 {
 	static const gchar *thisfn = "na_ipivot_consumer_interface_base_finalize";
 
-	if( !st_finalized ){
-
-		st_finalized = TRUE;
+	if( st_initialized && !st_finalized ){
 
 		g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
 
+		st_finalized = TRUE;
+
 		g_free( klass->private );
 	}
 }
@@ -159,16 +159,16 @@ na_ipivot_consumer_delay_notify( NAIPivotConsumer *instance )
 }
 
 /**
- * na_ipivot_consumer_notify_actions_changed:
+ * na_ipivot_consumer_notify_of_items_changed:
  * @instance: the #NAIPivotConsumer instance to be notified of the end
  * of the modifications.
  *
  * Notifies the consumers that the actions have been modified on one of
  * the underlying storage subsystems.
  */
-void na_ipivot_consumer_notify_actions_changed( NAIPivotConsumer *instance )
+void na_ipivot_consumer_notify_of_items_changed( NAIPivotConsumer *instance )
 {
-	static const gchar *thisfn = "na_ipivot_consumer_notify";
+	static const gchar *thisfn = "na_ipivot_consumer_notify_of_items_changed";
 
 	g_debug( "%s: instance=%p", thisfn, ( void * ) instance );
 
@@ -178,15 +178,15 @@ void na_ipivot_consumer_notify_actions_changed( NAIPivotConsumer *instance )
 
 		if( is_notify_allowed( instance )){
 
-			if( NA_IPIVOT_CONSUMER_GET_INTERFACE( instance )->on_actions_changed ){
-				NA_IPIVOT_CONSUMER_GET_INTERFACE( instance )->on_actions_changed( instance, NULL );
+			if( NA_IPIVOT_CONSUMER_GET_INTERFACE( instance )->on_items_changed ){
+				NA_IPIVOT_CONSUMER_GET_INTERFACE( instance )->on_items_changed( instance, NULL );
 			}
 		}
 	}
 }
 
 /**
- * na_ipivot_consumer_notify_of_create_root_menu_change:
+ * na_ipivot_consumer_notify_of_create_root_menu_changed:
  * @instance: the #NAIPivotConsumer instance to be notified of the end
  * of the modifications.
  * @enabled: whether a root menu should be created.
@@ -194,7 +194,7 @@ void na_ipivot_consumer_notify_actions_changed( NAIPivotConsumer *instance )
  * Notifies the consumers that the setting has been changed.
  */
 void
-na_ipivot_consumer_notify_of_create_root_menu_change( NAIPivotConsumer *instance, gboolean enabled )
+na_ipivot_consumer_notify_of_create_root_menu_changed( NAIPivotConsumer *instance, gboolean enabled )
 {
 	g_return_if_fail( NA_IS_IPIVOT_CONSUMER( instance ));
 
@@ -210,7 +210,7 @@ na_ipivot_consumer_notify_of_create_root_menu_change( NAIPivotConsumer *instance
 }
 
 /**
- * na_ipivot_consumer_notify_of_display_about_change:
+ * na_ipivot_consumer_notify_of_display_about_changed:
  * @instance: the #NAIPivotConsumer instance to be notified of the end
  * of the modifications.
  * @enabled: whether the 'About' item should be enabled.
@@ -219,7 +219,7 @@ na_ipivot_consumer_notify_of_create_root_menu_change( NAIPivotConsumer *instance
  * item in the Nautilus context menu has been changed.
  */
 void
-na_ipivot_consumer_notify_of_display_about_change( NAIPivotConsumer *instance, gboolean enabled )
+na_ipivot_consumer_notify_of_display_about_changed( NAIPivotConsumer *instance, gboolean enabled )
 {
 	g_return_if_fail( NA_IS_IPIVOT_CONSUMER( instance ));
 
@@ -235,7 +235,7 @@ na_ipivot_consumer_notify_of_display_about_change( NAIPivotConsumer *instance, g
 }
 
 /**
- * na_ipivot_consumer_notify_of_display_order_change:
+ * na_ipivot_consumer_notify_of_display_order_changed:
  * @instance: the #NAIPivotConsumer instance to be notified of the end
  * of the modifications.
  * @order_mode: new order mode.
@@ -243,7 +243,7 @@ na_ipivot_consumer_notify_of_display_about_change( NAIPivotConsumer *instance, g
  * Notifies the consumers that the display order has been changed.
  */
 void
-na_ipivot_consumer_notify_of_display_order_change( NAIPivotConsumer *instance, gint order_mode )
+na_ipivot_consumer_notify_of_display_order_changed( NAIPivotConsumer *instance, gint order_mode )
 {
 	g_return_if_fail( NA_IS_IPIVOT_CONSUMER( instance ));
 
diff --git a/src/core/na-ipivot-consumer.h b/src/core/na-ipivot-consumer.h
index 01cb6d4..4b0cb3d 100644
--- a/src/core/na-ipivot-consumer.h
+++ b/src/core/na-ipivot-consumer.h
@@ -28,8 +28,8 @@
  *   ... and many others (see AUTHORS)
  */
 
-#ifndef __NA_RUNTIME_IPIVOT_CONSUMER_H__
-#define __NA_RUNTIME_IPIVOT_CONSUMER_H__
+#ifndef __CORE_NA_IPIVOT_CONSUMER_H__
+#define __CORE_NA_IPIVOT_CONSUMER_H__
 
 /**
  * SECTION: na_ipivot_consumer
@@ -50,7 +50,7 @@ G_BEGIN_DECLS
 #define NA_IS_IPIVOT_CONSUMER( object )					( G_TYPE_CHECK_INSTANCE_TYPE( object, NA_IPIVOT_CONSUMER_TYPE ))
 #define NA_IPIVOT_CONSUMER_GET_INTERFACE( instance )	( G_TYPE_INSTANCE_GET_INTERFACE(( instance ), NA_IPIVOT_CONSUMER_TYPE, NAIPivotConsumerInterface ))
 
-typedef struct NAIPivotConsumer NAIPivotConsumer;
+typedef struct NAIPivotConsumer                 NAIPivotConsumer;
 
 typedef struct NAIPivotConsumerInterfacePrivate NAIPivotConsumerInterfacePrivate;
 
@@ -59,7 +59,7 @@ typedef struct {
 	NAIPivotConsumerInterfacePrivate *private;
 
 	/**
-	 * on_actions_changed:
+	 * on_items_changed:
 	 * @instance: the #NAIPivotConsumer instance which implements this
 	 * interface.
 	 * user_data: user data set when emitting the message. Currently,
@@ -69,7 +69,7 @@ typedef struct {
 	 * a bunch of modifications. At this time, the embedded list of
 	 * #NAAction has been updated to be up to date.
 	 */
-	void ( *on_actions_changed )         ( NAIPivotConsumer *instance, gpointer user_data );
+	void ( *on_items_changed )           ( NAIPivotConsumer *instance, gpointer user_data );
 
 	/**
 	 * on_create_root_menu_changed:
@@ -110,11 +110,11 @@ GType na_ipivot_consumer_get_type( void );
 
 void  na_ipivot_consumer_delay_notify( NAIPivotConsumer *instance );
 
-void  na_ipivot_consumer_notify_actions_changed( NAIPivotConsumer *instance );
-void  na_ipivot_consumer_notify_of_create_root_menu_change( NAIPivotConsumer *instance, gboolean enabled );
-void  na_ipivot_consumer_notify_of_display_about_change( NAIPivotConsumer *instance, gboolean enabled );
-void  na_ipivot_consumer_notify_of_display_order_change( NAIPivotConsumer *instance, gint order_mode );
+void  na_ipivot_consumer_notify_of_items_changed           ( NAIPivotConsumer *instance );
+void  na_ipivot_consumer_notify_of_create_root_menu_changed( NAIPivotConsumer *instance, gboolean enabled );
+void  na_ipivot_consumer_notify_of_display_about_changed   ( NAIPivotConsumer *instance, gboolean enabled );
+void  na_ipivot_consumer_notify_of_display_order_changed   ( NAIPivotConsumer *instance, gint order_mode );
 
 G_END_DECLS
 
-#endif /* __NA_RUNTIME_IPIVOT_CONSUMER_H__ */
+#endif /* __CORE_NA_IPIVOT_CONSUMER_H__ */



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