sparse cleanups for nautilus



Please take a look at the cleanups attached.

All the #ifdef'ed out code should probably be documented too. Why are
the #ifdef's there, and what is needed to get to the point where the
#ifdef's can be removed?

Cheers
Kjartan

Index: src/nautilus-navigation-bar.c
===================================================================
--- src/nautilus-navigation-bar.c	(revisjon 12763)
+++ src/nautilus-navigation-bar.c	(arbeidskopi)
@@ -72,7 +72,7 @@ nautilus_navigation_bar_class_init (Naut
 	signals[CANCEL] = g_signal_new
 		("cancel",
 		 G_TYPE_FROM_CLASS (object_class),
-		 G_SIGNAL_RUN_LAST | GTK_RUN_ACTION,
+		 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		 G_STRUCT_OFFSET (NautilusNavigationBarClass,
 				    cancel),
 		 NULL, NULL,
Index: src/nautilus-window-private.h
===================================================================
--- src/nautilus-window-private.h	(revisjon 12763)
+++ src/nautilus-window-private.h	(arbeidskopi)
@@ -188,7 +188,7 @@ void               nautilus_menus_append
                                                                           guint              merge_id,
                                                                           GCallback          refresh_callback,
                                                                           NautilusBookmarkFailedCallback failed_callback);
-#if NEW_UI_COMPLETE
+#ifdef NEW_UI_COMPLETE
 void               nautilus_window_go_up                                 (NautilusWindow    *window);
 #endif
 void               nautilus_window_update_find_menu_item                 (NautilusWindow    *window);
Index: src/file-manager/fm-desktop-icon-view.c
===================================================================
--- src/file-manager/fm-desktop-icon-view.c	(revisjon 12763)
+++ src/file-manager/fm-desktop-icon-view.c	(arbeidskopi)
@@ -396,7 +396,7 @@ realized_callback (GtkWidget *widget, FM
 	net_workarea_changed (desktop_icon_view, root_window);
 
 	/* Setup the property filter */
-	gdk_window_set_events (root_window, GDK_PROPERTY_NOTIFY);
+	gdk_window_set_events (root_window, GDK_PROPERTY_CHANGE_MASK);
 	gdk_window_add_filter (root_window,
 			       desktop_icon_view_property_filter,
 			       desktop_icon_view);
Index: src/file-manager/fm-list-model.c
===================================================================
--- src/file-manager/fm-list-model.c	(revisjon 12763)
+++ src/file-manager/fm-list-model.c	(arbeidskopi)
@@ -120,7 +120,7 @@ file_entry_free (FileEntry *file_entry)
 	g_free (file_entry);
 }
 
-static guint
+static GtkTreeModelFlags
 fm_list_model_get_flags (GtkTreeModel *tree_model)
 {
 	return GTK_TREE_MODEL_ITERS_PERSIST;
Index: src/file-manager/fm-directory-view.c
===================================================================
--- src/file-manager/fm-directory-view.c	(revisjon 12763)
+++ src/file-manager/fm-directory-view.c	(arbeidskopi)
@@ -791,7 +791,7 @@ fm_directory_view_launch_application (Gn
 	}
 }				      
 
-#if NEW_MIME_COMPLETE
+#ifdef NEW_MIME_COMPLETE
 static void
 fm_directory_view_chose_application_callback (GnomeVFSMimeApplication *application, 
 					      gpointer callback_data)
Index: src/file-manager/fm-list-view.c
===================================================================
--- src/file-manager/fm-list-view.c	(revisjon 12763)
+++ src/file-manager/fm-list-view.c	(arbeidskopi)
@@ -2509,11 +2509,9 @@ fm_list_view_emblems_changed (FMDirector
 {
 	g_assert (FM_IS_LIST_VIEW (directory_view));
 
-#if GNOME2_CONVERSION_COMPLETE
 	/* FIXME: This needs to update the emblems of the icons, since
 	 * relative emblems may have changed.
 	 */
-#endif
 }
 
 static char *
Index: src/file-manager/fm-tree-model.c
===================================================================
--- src/file-manager/fm-tree-model.c	(revisjon 12763)
+++ src/file-manager/fm-tree-model.c	(arbeidskopi)
@@ -124,7 +124,7 @@ static void destroy_node_without_reporti
 static void report_node_contents_changed   (FMTreeModel *model,
 					    TreeNode          *node);
 
-static guint
+static GtkTreeModelFlags 
 fm_tree_model_get_flags (GtkTreeModel *tree_model)
 {
 	return GTK_TREE_MODEL_ITERS_PERSIST;
@@ -489,7 +489,7 @@ create_node_for_file (FMTreeModelRoot *r
 	return node;
 }
 
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 
 static char *
 get_node_uri (GtkTreeIter *iter)
@@ -525,7 +525,7 @@ abandon_node_ref_count (FMTreeModel *mod
 {
 	if (node->parent != NULL) {
 		decrement_ref_count (model, node->parent, node->ref_count);
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 		if (node->ref_count != 0) {
 			char *uri;
 
@@ -544,7 +544,7 @@ abandon_dummy_row_ref_count (FMTreeModel
 {
 	decrement_ref_count (model, node, node->dummy_child_ref_count);
 	if (node->dummy_child_ref_count != 0) {
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 		char *uri;
 
 		uri = nautilus_file_get_uri (node->file);
@@ -1475,7 +1475,7 @@ static void
 fm_tree_model_ref_node (GtkTreeModel *model, GtkTreeIter *iter)
 {
 	TreeNode *node, *parent;
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 	char *uri;
 #endif
 
@@ -1501,7 +1501,7 @@ fm_tree_model_ref_node (GtkTreeModel *mo
 			}
 			schedule_monitoring_update (FM_TREE_MODEL (model));
 		}
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 		uri = get_node_uri (iter);
 		g_message ("ref of %s, count is now %d",
 			   uri, parent->all_children_ref_count);
@@ -1514,7 +1514,7 @@ static void
 fm_tree_model_unref_node (GtkTreeModel *model, GtkTreeIter *iter)
 {
 	TreeNode *node, *parent;
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 	char *uri;
 #endif
 
@@ -1534,7 +1534,7 @@ fm_tree_model_unref_node (GtkTreeModel *
 
 	if (parent != NULL) {
 		g_assert (parent->all_children_ref_count > 0);
-#if LOG_REF_COUNTS
+#ifdef LOG_REF_COUNTS
 		uri = get_node_uri (iter);
 		g_message ("unref of %s, count is now %d",
 			   uri, parent->all_children_ref_count - 1);
Index: src/nautilus-search-bar.c
===================================================================
--- src/nautilus-search-bar.c	(revisjon 12763)
+++ src/nautilus-search-bar.c	(arbeidskopi)
@@ -89,7 +89,7 @@ nautilus_search_bar_class_init (Nautilus
 	signals[CANCEL] =
 		g_signal_new ("cancel",
 			      G_TYPE_FROM_CLASS (class),
-			      G_SIGNAL_RUN_LAST | GTK_RUN_ACTION,
+			      G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 			      G_STRUCT_OFFSET (NautilusSearchBarClass, cancel),
 			      NULL, NULL,
 			      g_cclosure_marshal_VOID__VOID,
Index: src/nautilus-image-properties-page.c
===================================================================
--- src/nautilus-image-properties-page.c	(revisjon 12763)
+++ src/nautilus-image-properties-page.c	(arbeidskopi)
@@ -144,7 +144,7 @@ static void
 exif_content_callback (ExifContent *content, gpointer data)
 {
 	struct ExifAttribute *attribute;
-#if !HAVE_OLD_EXIF
+#ifndef HAVE_OLD_EXIF
 	char b[1024];
 #endif
 
Index: src/nautilus-query-editor.c
===================================================================
--- src/nautilus-query-editor.c	(revisjon 12763)
+++ src/nautilus-query-editor.c	(arbeidskopi)
@@ -209,7 +209,7 @@ nautilus_query_editor_class_init (Nautil
 	signals[CANCEL] =
 		g_signal_new ("cancel",
 		              G_TYPE_FROM_CLASS (class),
-		              G_SIGNAL_RUN_LAST | GTK_RUN_ACTION,
+		              G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
 		              G_STRUCT_OFFSET (NautilusQueryEditorClass, cancel),
 		              NULL, NULL,
 		              g_cclosure_marshal_VOID__VOID,
Index: libnautilus-private/nautilus-program-choosing.c
===================================================================
--- libnautilus-private/nautilus-program-choosing.c	(revisjon 12763)
+++ libnautilus-private/nautilus-program-choosing.c	(arbeidskopi)
@@ -121,7 +121,7 @@ application_cannot_open_location (GnomeV
 				  const char *uri_scheme,
 				  GtkWindow *parent_window)
 {
-#if NEW_MIME_COMPLETE
+#ifdef NEW_MIME_COMPLETE
 	GtkDialog *message_dialog;
 	LaunchParameters *launch_parameters;
 	char *prompt;
@@ -569,7 +569,7 @@ void nautilus_launch_show_file (Nautilus
 		
 	case GNOME_VFS_ERROR_NO_DEFAULT:
 	case GNOME_VFS_ERROR_NO_HANDLER:
-#if NEW_MIME_COMPLETE
+#ifdef NEW_MIME_COMPLETE
 		nautilus_program_chooser_show_no_choices_message
 					(action_type, file, parent_window);
 		break;
@@ -629,7 +629,7 @@ void nautilus_launch_show_file (Nautilus
 			break;
 		case GNOME_VFS_OK:
 		default:
-#if NEW_MIME_COMPLETE
+#ifdef NEW_MIME_COMPLETE
 			nautilus_program_chooser_show_invalid_message
 				(action_type, file, parent_window);
 #endif
@@ -816,7 +816,7 @@ nautilus_launch_application (GnomeVFSMim
 		break;
 
 	default:
-#if NEW_MIME_COMPLETE
+#ifdef NEW_MIME_COMPLETE
 		nautilus_program_chooser_show_invalid_message
 			(GNOME_VFS_MIME_ACTION_TYPE_APPLICATION, file, parent_window);
 			 
Index: libnautilus-private/nautilus-icon-canvas-item.c
===================================================================
--- libnautilus-private/nautilus-icon-canvas-item.c	(revisjon 12763)
+++ libnautilus-private/nautilus-icon-canvas-item.c	(arbeidskopi)
@@ -938,8 +938,8 @@ draw_or_measure_label_text (NautilusIcon
 {
 	NautilusIconCanvasItemDetails *details;
 	NautilusIconContainer *container;
-	guint editable_height, editable_width, editable_dx;
-	guint additional_height, additional_width, additional_dx;
+	gint editable_height, editable_width, editable_dx;
+	gint additional_height, additional_width, additional_dx;
 	EelCanvasItem *canvas_item;
 	PangoLayout *editable_layout;
 	PangoLayout *additional_layout;
Index: libnautilus-private/nautilus-trash-file.c
===================================================================
--- libnautilus-private/nautilus-trash-file.c	(revisjon 12763)
+++ libnautilus-private/nautilus-trash-file.c	(arbeidskopi)
@@ -558,7 +558,8 @@ trash_file_get_item_count (NautilusFile 
 {
 	NautilusTrashFile *trash;
 	GList *node;
-	guint one_count, one_unreadable;
+	guint one_count;
+	int one_unreadable;
 	gboolean got_count;
 	
 	trash = NAUTILUS_TRASH_FILE (file);
Index: libnautilus-private/nautilus-icon-container.c
===================================================================
--- libnautilus-private/nautilus-icon-container.c	(revisjon 12763)
+++ libnautilus-private/nautilus-icon-container.c	(arbeidskopi)
@@ -6451,7 +6451,7 @@ nautilus_icon_container_show_stretch_han
 {
 	NautilusIconContainerDetails *details;
 	NautilusIcon *icon;
-	int initial_size;
+	guint initial_size;
 	
 	icon = get_first_selected_icon (container);
 	if (icon == NULL) {
Index: libnautilus-private/nautilus-tree-view-drag-dest.c
===================================================================
--- libnautilus-private/nautilus-tree-view-drag-dest.c	(revisjon 12763)
+++ libnautilus-private/nautilus-tree-view-drag-dest.c	(arbeidskopi)
@@ -358,7 +358,7 @@ get_drop_action (NautilusTreeViewDragDes
 		 GtkTreePath *path)
 {
 	char *drop_target;
-	guint action;
+	int action;
 	
 	if (!dest->details->have_drag_data ||
 	    (dest->details->drag_type == NAUTILUS_ICON_DND_GNOME_ICON_LIST &&
Index: libnautilus-private/nautilus-file.c
===================================================================
--- libnautilus-private/nautilus-file.c	(revisjon 12763)
+++ libnautilus-private/nautilus-file.c	(arbeidskopi)
@@ -1863,7 +1863,7 @@ prepend_automatic_emblem_names (Nautilus
 {
 	/* Prepend in reverse order. */
 
-#if TRASH_IS_FAST_ENOUGH
+#ifdef TRASH_IS_FAST_ENOUGH
 	if (nautilus_file_is_in_trash (file)) {
 		names = g_list_prepend
 			(names, g_strdup (NAUTILUS_FILE_EMBLEM_NAME_TRASH));


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