[nautilus/remove-emblems-splitted: 14/23] Remove dead code from the properties window.



commit 4c465f5590f3e908b98197faeb63767193bb6e79
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Jul 25 12:04:25 2010 +0200

    Remove dead code from the properties window.

 src/file-manager/fm-properties-window.c |  165 -------------------------------
 1 files changed, 0 insertions(+), 165 deletions(-)
---
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 48481b2..fb0157f 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -841,167 +841,6 @@ name_field_activate (NautilusEntry *name_field, gpointer callback_data)
 	nautilus_entry_select_all_at_idle (name_field);
 }
 
-static gboolean
-file_has_keyword (NautilusFile *file, const char *keyword)
-{
-	GList *keywords, *word;
-
-	keywords = nautilus_file_get_keywords (file);
-	word = g_list_find_custom (keywords, keyword, (GCompareFunc) strcmp);
-	eel_g_list_free_deep (keywords);
-	
-	return (word != NULL);
-}
-
-static void
-get_initial_emblem_state (FMPropertiesWindow *window,
-			  const char *name,
-			  GList **on,
-			  GList **off)
-{
-	GList *l;
-	
-	*on = NULL;
-	*off = NULL;
-	
-	for (l = window->details->original_files; l != NULL; l = l->next) {
-		GList *initial_emblems;
-		
-		initial_emblems = g_hash_table_lookup (window->details->initial_emblems,
-						       l->data);
-		
-		if (g_list_find_custom (initial_emblems, name, (GCompareFunc) strcmp)) {
-			*on = g_list_prepend (*on, l->data);
-		} else {
-			*off = g_list_prepend (*off, l->data);
-		}
-	}
-}
-
-static void
-emblem_button_toggled (GtkToggleButton *button,
-		       FMPropertiesWindow *window)
-{
-	GList *l;
-	GList *keywords;
-	GList *word;
-	char *name;
-	GList *files_on;
-	GList *files_off;
-
-	name = g_object_get_data (G_OBJECT (button), "nautilus_emblem_name");
-
-	files_on = NULL;
-	files_off = NULL;
-	if (gtk_toggle_button_get_active (button)
-	    && !gtk_toggle_button_get_inconsistent (button)) {
-		/* Go to the initial state unless the initial state was 
-		   consistent */
-		get_initial_emblem_state (window, name, 
-					  &files_on, &files_off);
-		
-		if (!(files_on && files_off)) {
-			g_list_free (files_on);
-			g_list_free (files_off);
-			files_on = g_list_copy (window->details->original_files);
-			files_off = NULL;
-		}
-	} else if (gtk_toggle_button_get_inconsistent (button)
-		   && !gtk_toggle_button_get_active (button)) {
-		files_on = g_list_copy (window->details->original_files);
-		files_off = NULL;
-	} else {
-		files_off = g_list_copy (window->details->original_files);
-		files_on = NULL;
-	}
-	
-	g_signal_handlers_block_by_func (G_OBJECT (button), 
-					 G_CALLBACK (emblem_button_toggled),
-					 window);
-	
-	gtk_toggle_button_set_active (button, files_on != NULL);
-	gtk_toggle_button_set_inconsistent (button, files_on && files_off);
-
-	g_signal_handlers_unblock_by_func (G_OBJECT (button), 
-					   G_CALLBACK (emblem_button_toggled),
-					   window);
-
-	for (l = files_on; l != NULL; l = l->next) {
-		NautilusFile *file;
-		
-		file = NAUTILUS_FILE (l->data);
-		
-		keywords = nautilus_file_get_keywords (file);
-		
-		word = g_list_find_custom (keywords, name,  (GCompareFunc)strcmp);
-		if (!word) {
-			keywords = g_list_prepend (keywords, g_strdup (name));
-		}
-		nautilus_file_set_keywords (file, keywords);
-		eel_g_list_free_deep (keywords);
-	}
-	
-	for (l = files_off; l != NULL; l = l->next) {
-		NautilusFile *file;
-		
-		file = NAUTILUS_FILE (l->data);
-
-		keywords = nautilus_file_get_keywords (file);
-		
-		word = g_list_find_custom (keywords, name,  (GCompareFunc)strcmp);
-		if (word) {
-			keywords = g_list_remove_link (keywords, word);
-			eel_g_list_free_deep (word);
-		}
-		nautilus_file_set_keywords (file, keywords);
-		eel_g_list_free_deep (keywords);
-	}	
-
-	g_list_free (files_on);
-	g_list_free (files_off);	
-}
-
-static void
-emblem_button_update (FMPropertiesWindow *window,
-			GtkToggleButton *button)
-{
-	GList *l;
-	char *name;
-	gboolean all_set;
-	gboolean all_unset;
-
-	name = g_object_get_data (G_OBJECT (button), "nautilus_emblem_name");
-
-	all_set = TRUE;
-	all_unset = TRUE;
-	for (l = window->details->original_files; l != NULL; l = l->next) {
-		gboolean has_keyword;
-		NautilusFile *file;
-
-		file = NAUTILUS_FILE (l->data);
-		
-		has_keyword = file_has_keyword (file, name);
-
-		if (has_keyword) {
-			all_unset = FALSE;
-		} else {
-			all_set = FALSE;
-		}
-	}
-	
-	g_signal_handlers_block_by_func (G_OBJECT (button), 
-					 G_CALLBACK (emblem_button_toggled),
-					 window);
-
-	gtk_toggle_button_set_active (button, !all_unset);
-	gtk_toggle_button_set_inconsistent (button, !all_unset && !all_set);
-
-	g_signal_handlers_unblock_by_func (G_OBJECT (button), 
-					   G_CALLBACK (emblem_button_toggled),
-					   window);
-
-}
-
 static void
 update_properties_window_title (FMPropertiesWindow *window)
 {
@@ -1179,10 +1018,6 @@ properties_window_update (FMPropertiesWindow *window,
 
 		update_name_field (window);
 
-		for (l = window->details->emblem_buttons; l != NULL; l = l->next) {
-			emblem_button_update (window, GTK_TOGGLE_BUTTON (l->data));
-		}
-		
 		/* If any of the value fields start to depend on the original
 		 * value, value_field_updates should be added here */
 	}



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