? filter.error
? warnings
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/filter/ChangeLog,v
retrieving revision 1.431
diff -u -p -r1.431 ChangeLog
--- ChangeLog	31 Dec 2005 14:30:26 -0000	1.431
+++ ChangeLog	9 Jan 2006 10:21:33 -0000
@@ -1,3 +1,10 @@
+2006-01-09  Kjartan Maraas  <kmaraas@gnome.org>
+
+	* filter-element.c: (filter_element_get_type): Remove unused code
+	* rule-editor.c: (rule_editor_add_undo), (rule_editor_play_undo),
+	(editor_response), (set_source): Move around some code to avoind
+	unneccesary prototypes.
+
 2005-12-20  Matthew Hall  <matt@castleinthesky.org>
 
 	* filter.glade; rule-editor.c: adding top/bottom buttons for
Index: filter-element.c
===================================================================
RCS file: /cvs/gnome/evolution/filter/filter-element.c,v
retrieving revision 1.34
diff -u -p -r1.34 filter-element.c
--- filter-element.c	17 Jun 2004 07:34:07 -0000	1.34
+++ filter-element.c	9 Jan 2006 10:21:34 -0000
@@ -48,7 +48,6 @@ static void filter_element_init	(FilterE
 static void filter_element_finalise (GObject *obj);
 
 static GObjectClass *parent_class = NULL;
-static GHashTable *fe_table;
 
 GType
 filter_element_get_type (void)
@@ -67,7 +66,6 @@ filter_element_get_type (void)
 			0,    /* n_preallocs */
 			(GInstanceInitFunc) filter_element_init,
 		};
-		fe_table = g_hash_table_new(g_str_hash, g_str_equal);
 		type = g_type_register_static (G_TYPE_OBJECT, "FilterElement", &info, 0);
 	}
 	
Index: rule-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/filter/rule-editor.c,v
retrieving revision 1.66
diff -u -p -r1.66 rule-editor.c
--- rule-editor.c	20 Dec 2005 18:21:51 -0000	1.66
+++ rule-editor.c	9 Jan 2006 10:21:34 -0000
@@ -37,9 +37,6 @@
 
 static int enable_undo = 0;
 
-void rule_editor_add_undo (RuleEditor *re, int type, FilterRule *rule, int rank, int newrank);
-void rule_editor_play_undo (RuleEditor *re);
-
 #define d(x)
 
 static void set_source (RuleEditor *re, const char *source);
@@ -230,6 +227,95 @@ editor_destroy (RuleEditor *re, GObject 
 }
 
 static void
+rule_editor_add_undo (RuleEditor *re, int type, FilterRule *rule, int rank, int newrank)
+{
+        RuleEditorUndo *undo;
+
+        if (!re->undo_active && enable_undo) {
+                undo = g_malloc0 (sizeof (*undo));
+                undo->rule = rule;
+                undo->type = type;
+                undo->rank = rank;
+                undo->newrank = newrank;
+
+                undo->next = re->undo_log;
+                re->undo_log = undo;
+        } else {
+                g_object_unref (rule);
+        }
+}
+
+static void
+rule_editor_play_undo (RuleEditor *re)
+{
+	RuleEditorUndo *undo, *next;
+	FilterRule *rule;
+	
+	re->undo_active = TRUE;
+	undo = re->undo_log;
+	re->undo_log = NULL;
+	while (undo) {
+		next = undo->next;
+		switch (undo->type) {
+		case RULE_EDITOR_LOG_EDIT:
+			d(printf ("Undoing edit on rule '%s'\n", undo->rule->name));
+			rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
+			if (rule) {
+				d(printf (" name was '%s'\n", rule->name));
+				filter_rule_copy (rule, undo->rule);
+				d(printf (" name is '%s'\n", rule->name));
+			} else {
+				g_warning ("Could not find the right rule to undo against?");
+			}
+			break;
+		case RULE_EDITOR_LOG_ADD:
+			d(printf ("Undoing add on rule '%s'\n", undo->rule->name));
+			rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
+			if (rule)
+				rule_context_remove_rule (re->context, rule);
+			break;
+		case RULE_EDITOR_LOG_REMOVE:
+			d(printf ("Undoing remove on rule '%s'\n", undo->rule->name));
+			g_object_ref (undo->rule);
+			rule_context_add_rule (re->context, undo->rule);
+			rule_context_rank_rule (re->context, undo->rule, re->source, undo->rank);
+			break;
+		case RULE_EDITOR_LOG_RANK:
+			rule = rule_context_find_rank_rule (re->context, undo->newrank, undo->rule->source);
+			if (rule)
+				rule_context_rank_rule (re->context, rule, re->source, undo->rank);
+			break;
+		}
+		
+		g_object_unref (undo->rule);
+		g_free (undo);
+		undo = next;
+	}
+	re->undo_active = FALSE;
+}
+
+static void
+editor_response (GtkWidget *dialog, int button, RuleEditor *re)
+{
+	if (button == GTK_RESPONSE_CANCEL) {
+		if (enable_undo)
+			rule_editor_play_undo (re);
+		else {
+			RuleEditorUndo *undo, *next;
+			
+			undo = re->undo_log;
+			re->undo_log = 0;
+			while (undo) {
+				next = undo->next;
+				g_object_unref (undo->rule);
+				g_free (undo);
+				undo = next;
+			}
+		}
+	}
+}
+
+static void
 add_editor_response (GtkWidget *dialog, int button, RuleEditor *re)
 {
 	GtkTreeSelection *selection;
@@ -619,95 +705,6 @@ set_source (RuleEditor *re, const char *
 	re->source = g_strdup (source);
 	re->current = NULL;
 	rule_editor_set_sensitive (re);
-}
-
-void
-rule_editor_add_undo (RuleEditor *re, int type, FilterRule *rule, int rank, int newrank)
-{
-	RuleEditorUndo *undo;
-	
-	if (!re->undo_active && enable_undo) {
-		undo = g_malloc0 (sizeof (*undo));
-		undo->rule = rule;
-		undo->type = type;
-		undo->rank = rank;
-		undo->newrank = newrank;
-		
-		undo->next = re->undo_log;
-		re->undo_log = undo;
-	} else {
-		g_object_unref (rule);
-	}
-}
-
-void
-rule_editor_play_undo (RuleEditor *re)
-{
-	RuleEditorUndo *undo, *next;
-	FilterRule *rule;
-	
-	re->undo_active = TRUE;
-	undo = re->undo_log;
-	re->undo_log = NULL;
-	while (undo) {
-		next = undo->next;
-		switch (undo->type) {
-		case RULE_EDITOR_LOG_EDIT:
-			d(printf ("Undoing edit on rule '%s'\n", undo->rule->name));
-			rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
-			if (rule) {
-				d(printf (" name was '%s'\n", rule->name));
-				filter_rule_copy (rule, undo->rule);
-				d(printf (" name is '%s'\n", rule->name));
-			} else {
-				g_warning ("Could not find the right rule to undo against?");
-			}
-			break;
-		case RULE_EDITOR_LOG_ADD:
-			d(printf ("Undoing add on rule '%s'\n", undo->rule->name));
-			rule = rule_context_find_rank_rule (re->context, undo->rank, undo->rule->source);
-			if (rule)
-				rule_context_remove_rule (re->context, rule);
-			break;
-		case RULE_EDITOR_LOG_REMOVE:
-			d(printf ("Undoing remove on rule '%s'\n", undo->rule->name));
-			g_object_ref (undo->rule);
-			rule_context_add_rule (re->context, undo->rule);
-			rule_context_rank_rule (re->context, undo->rule, re->source, undo->rank);
-			break;
-		case RULE_EDITOR_LOG_RANK:
-			rule = rule_context_find_rank_rule (re->context, undo->newrank, undo->rule->source);
-			if (rule)
-				rule_context_rank_rule (re->context, rule, re->source, undo->rank);
-			break;
-		}
-		
-		g_object_unref (undo->rule);
-		g_free (undo);
-		undo = next;
-	}
-	re->undo_active = FALSE;
-}
-
-static void
-editor_response (GtkWidget *dialog, int button, RuleEditor *re)
-{
-	if (button == GTK_RESPONSE_CANCEL) {
-		if (enable_undo)
-			rule_editor_play_undo (re);
-		else {
-			RuleEditorUndo *undo, *next;
-			
-			undo = re->undo_log;
-			re->undo_log = 0;
-			while (undo) {
-				next = undo->next;
-				g_object_unref (undo->rule);
-				g_free (undo);
-				undo = next;
-			}
-		}
-	}
 }
 
 GtkWidget *rule_editor_treeview_new (char *widget_name, char *string1, char *string2,
