[nautilus-actions] Allow the clipboard to be dumped even if never used yet



commit f5af2beef20af42c6895f9347172d5d16c478aba
Author: Pierre Wieser <pwieser trychlos org>
Date:   Mon Dec 7 06:46:54 2009 +0100

    Allow the clipboard to be dumped even if never used yet

 ChangeLog                              |    3 +++
 TODO                                   |    2 --
 nautilus-actions/nact/nact-clipboard.c |   30 +++++++++++++++++-------------
 3 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 00fbfe5..7a462d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2009-12-07 Pierre Wieser <pwieser trychlos org>
 
+	* nautilus-actions/nact/nact-clipboard.c (nact_clipboard_dump):
+	Allow dump when clipboard has not been yet used.
+
 	* nautilus-actions/api/na-object-api.h:
 	All arguments have parenthesis around them.
 
diff --git a/TODO b/TODO
index dab5429..e941f45 100644
--- a/TODO
+++ b/TODO
@@ -104,5 +104,3 @@
 - nact: when pasting an item, should reset provider and read-only flag
 
 - desktop provider: fix default toolbar label
-
-- dump clipboard: test if null
diff --git a/nautilus-actions/nact/nact-clipboard.c b/nautilus-actions/nact/nact-clipboard.c
index afdf091..dd16087 100644
--- a/nautilus-actions/nact/nact-clipboard.c
+++ b/nautilus-actions/nact/nact-clipboard.c
@@ -784,20 +784,24 @@ nact_clipboard_dump( NactClipboard *clipboard )
 		g_debug( "%s:          dnd=%p", thisfn, ( void * ) clipboard->private->dnd );
 		g_debug( "%s:      primary=%p", thisfn, ( void * ) clipboard->private->primary );
 		g_debug( "%s: primary_data=%p", thisfn, ( void * ) clipboard->private->primary_data );
-		g_debug( "%s:  primary_data->nb_actions=%d", thisfn, clipboard->private->primary_data->nb_actions );
-		g_debug( "%s: primary_data->nb_profiles=%d", thisfn, clipboard->private->primary_data->nb_profiles );
-		g_debug( "%s:    primary_data->nb_menus=%d", thisfn, clipboard->private->primary_data->nb_menus );
-		g_debug( "%s:       primary_data->items=%p (count=%d)",
-				thisfn,
-				( void * ) clipboard->private->primary_data->items,
-				clipboard->private->primary_data->items ? g_list_length( clipboard->private->primary_data->items ) : 0 );
-		mode = clipboard_mode_to_string( clipboard->private->primary_data->mode );
-		g_debug( "%s:       primary_data->mode=%d (%s)", thisfn, clipboard->private->primary_data->mode, mode );
-		g_free( mode );
-		g_debug( "%s:  primary_got=%s", thisfn, ( void * ) clipboard->private->primary_got ? "True":"False" );
-		for( it = clipboard->private->primary_data->items ; it ; it = it->next ){
-			na_object_object_dump( NA_OBJECT( it->data ));
+
+		if( clipboard->private->primary_data ){
+			g_debug( "%s:  primary_data->nb_actions=%d", thisfn, clipboard->private->primary_data->nb_actions );
+			g_debug( "%s: primary_data->nb_profiles=%d", thisfn, clipboard->private->primary_data->nb_profiles );
+			g_debug( "%s:    primary_data->nb_menus=%d", thisfn, clipboard->private->primary_data->nb_menus );
+			g_debug( "%s:       primary_data->items=%p (count=%d)",
+					thisfn,
+					( void * ) clipboard->private->primary_data->items,
+					clipboard->private->primary_data->items ? g_list_length( clipboard->private->primary_data->items ) : 0 );
+			mode = clipboard_mode_to_string( clipboard->private->primary_data->mode );
+			g_debug( "%s:       primary_data->mode=%d (%s)", thisfn, clipboard->private->primary_data->mode, mode );
+			g_free( mode );
+			for( it = clipboard->private->primary_data->items ; it ; it = it->next ){
+				na_object_object_dump( NA_OBJECT( it->data ));
+			}
 		}
+
+		g_debug( "%s:  primary_got=%s", thisfn, ( void * ) clipboard->private->primary_got ? "True":"False" );
 	}
 }
 



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