[nautilus-actions] Lightened check_edition_status traces



commit c35803276f2bcf08723ecfef12c030ceb467b5f5
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Sep 21 07:05:53 2009 +0200

    Lightened check_edition_status traces

 src/common/na-iduplicable.c |   15 +++++++++++++++
 src/common/na-iduplicable.h |    2 ++
 src/common/na-obj-action.c  |    4 ++++
 src/common/na-object-item.c |    4 ++++
 4 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/common/na-iduplicable.c b/src/common/na-iduplicable.c
index dcef11b..ffbbdc9 100644
--- a/src/common/na-iduplicable.c
+++ b/src/common/na-iduplicable.c
@@ -284,12 +284,16 @@ na_iduplicable_duplicate( const NAIDuplicable *object )
 void
 na_iduplicable_check_edition_status( const NAIDuplicable *object )
 {
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 	static const gchar *thisfn = "na_iduplicable_check_edition_status";
+#endif
 	gboolean modified = TRUE;
 	NAIDuplicable *origin;
 	gboolean valid;
 
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 	g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));
+#endif
 	g_return_if_fail( st_initialized && !st_finalized );
 	g_return_if_fail( NA_IS_IDUPLICABLE( object ));
 
@@ -301,8 +305,11 @@ na_iduplicable_check_edition_status( const NAIDuplicable *object )
 
 	valid = v_is_valid( object );
 	set_valid( object, valid );
+
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 	g_debug( "%s: object=%p, modified=%s, valid=%s",
 			thisfn, ( void * ) object, modified ? "True":"False", valid ? "True":"False" );
+#endif
 }
 
 /**
@@ -471,8 +478,11 @@ set_modified( const NAIDuplicable *object, gboolean is_modified )
 	if( was_modified != is_modified ){
 		g_object_set_data( G_OBJECT( object ), NA_IDUPLICABLE_PROP_IS_MODIFIED, GUINT_TO_POINTER( is_modified ));
 		g_signal_emit_by_name( G_OBJECT( object ), NA_IDUPLICABLE_SIGNAL_MODIFIED_CHANGED, object );
+
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 		g_debug( "na_iduplicable_set_modified: object=%p (%s) modified=%s",
 				( void * ) object, G_OBJECT_TYPE_NAME( object ), is_modified ? "True":"False" );
+#endif
 	}
 }
 
@@ -490,5 +500,10 @@ set_valid( const NAIDuplicable *object, gboolean is_valid )
 	if( was_valid != is_valid ){
 		g_object_set_data( G_OBJECT( object ), NA_IDUPLICABLE_PROP_IS_VALID, GUINT_TO_POINTER( is_valid ));
 		g_signal_emit_by_name( G_OBJECT( object ), NA_IDUPLICABLE_SIGNAL_VALID_CHANGED, object );
+
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
+		g_debug( "na_iduplicable_set_valid: object=%p (%s) valid=%s",
+				( void * ) object, G_OBJECT_TYPE_NAME( object ), is_valid ? "True":"False" );
+#endif
 	}
 }
diff --git a/src/common/na-iduplicable.h b/src/common/na-iduplicable.h
index 2c869bb..920993f 100644
--- a/src/common/na-iduplicable.h
+++ b/src/common/na-iduplicable.h
@@ -145,6 +145,8 @@ typedef struct {
 #define NA_IDUPLICABLE_SIGNAL_MODIFIED_CHANGED	"na-iduplicable-modified-changed"
 #define NA_IDUPLICABLE_SIGNAL_VALID_CHANGED		"na-iduplicable-valid-changed"
 
+#define NA_IDUPLICABLE_EDITION_STATUS_DEBUG		0
+
 GType          na_iduplicable_get_type( void );
 
 void           na_iduplicable_init( NAIDuplicable *object );
diff --git a/src/common/na-obj-action.c b/src/common/na-obj-action.c
index 5bc235f..1c7ec22 100644
--- a/src/common/na-obj-action.c
+++ b/src/common/na-obj-action.c
@@ -581,9 +581,13 @@ object_are_equal( const NAObject *a, const NAObject *b )
 			id = na_object_get_id( ip->data );
 			profile = NA_OBJECT_PROFILE( na_object_get_item( b, id ));
 			equal = !na_object_is_modified( profile );
+
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 			if( !equal ){
 				g_debug( "na_object_action_are_equal: profile=%p, equal=False", ( void * ) profile );
 			}
+#endif
+
 			g_free( id );
 		}
 		na_object_free_items( profiles );
diff --git a/src/common/na-object-item.c b/src/common/na-object-item.c
index bcf7d0c..89880e9 100644
--- a/src/common/na-object-item.c
+++ b/src/common/na-object-item.c
@@ -877,7 +877,9 @@ object_are_equal( const NAObject *a, const NAObject *b )
 			if( second_obj ){
 				na_object_check_edition_status( second_obj );
 			} else {
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 				g_debug( "na_object_item_are_equal: object=%p (%s), equal=False", ( void * ) b, G_OBJECT_TYPE_NAME( b ));
+#endif
 				equal = FALSE;
 			}
 		}
@@ -890,7 +892,9 @@ object_are_equal( const NAObject *a, const NAObject *b )
 			first_obj = ( NAObject * ) na_object_get_item( a, second_id );
 			g_free( second_id );
 			if( !first_obj ){
+#if NA_IDUPLICABLE_EDITION_STATUS_DEBUG
 				g_debug( "na_object_item_are_equal: object=%p (%s), equal=False", ( void * ) b, G_OBJECT_TYPE_NAME( b ));
+#endif
 				equal = FALSE;
 			}
 		}



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