[patch] Bug #314721



Hello,

        This patch should correct bug #314721.
(http://bugzilla.gnome.org/show_bug.cgi?id=314721).

Bye,

Nicolas Centa
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.707
diff -u -p -r1.707 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	29 Aug 2005 09:53:17 -0000	1.707
+++ src/file-manager/fm-directory-view.c	29 Aug 2005 14:28:18 -0000
@@ -4556,48 +4556,6 @@ add_extension_menu_items (FMDirectoryVie
 	}
 }
 
-static gboolean
-has_file_in_list (GList *list, NautilusFile *file)
-{
-	gboolean ret = FALSE;
-	char *mime;
-       
-	mime = nautilus_file_get_mime_type (file);
-	
-	for (; list; list = list->next) {
-		NautilusFile *tmp_file = list->data;
-		char *tmp_mime = nautilus_file_get_mime_type (tmp_file);
-
-		if (strcmp (tmp_mime, mime) == 0) {
-			ret = TRUE;
-			g_free (tmp_mime);
-			break;
-		}
-
-		g_free (tmp_mime);
-	}
-	
-	g_free (mime);
-	return ret;
-}
-
-static GList *
-get_unique_files (GList *selection)
-{
-	GList *result;
-
-	result = NULL;
-	for (; selection; selection = selection->next) {
-		if (!has_file_in_list (result,
-				       NAUTILUS_FILE (selection->data))) {
-			result = g_list_prepend (result, selection->data);
-		}
-	}	
-
-	return g_list_reverse (result);
-}
-
-
 static void
 reset_extension_actions_menu (FMDirectoryView *view, GList *selection)
 {
@@ -4619,12 +4577,11 @@ reset_extension_actions_menu (FMDirector
 				      &view->details->extensions_menu_action_group);
 
 	/* only query for the unique files */
-	unique_selection = get_unique_files (selection);
 	items = get_all_extension_menu_items (gtk_widget_get_toplevel (GTK_WIDGET (view)), 
 					      selection);
 	
 	if (items) {
-		add_extension_menu_items (view, unique_selection, items);
+		add_extension_menu_items (view, selection, items);
 	
 		for (l = items; l != NULL; l = l->next) {
 			g_object_unref (l->data);
@@ -4632,8 +4589,6 @@ reset_extension_actions_menu (FMDirector
 		
 		g_list_free (items);
 	}
-
-	g_list_free (unique_selection);
 }
 
 static char *


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