aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-10-25 21:17:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-10-27 21:25:01 +0800
commit2b16aef84141800099f859e72d05e1e6bf8e02dd (patch)
treeb7168d8e9a4157a1f6733b0c667dd6239c5e0055 /mail
parent58166e645971a4812fef23702f45cacc8e64e419 (diff)
downloadgsoc2013-evolution-2b16aef84141800099f859e72d05e1e6bf8e02dd.tar.gz
gsoc2013-evolution-2b16aef84141800099f859e72d05e1e6bf8e02dd.tar.zst
gsoc2013-evolution-2b16aef84141800099f859e72d05e1e6bf8e02dd.zip
Cleanup and rename filter classes.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader-utils.c8
-rw-r--r--mail/em-filter-context.c86
-rw-r--r--mail/em-filter-context.h14
-rw-r--r--mail/em-filter-editor.c28
-rw-r--r--mail/em-filter-editor.h6
-rw-r--r--mail/em-filter-folder-element.c49
-rw-r--r--mail/em-filter-folder-element.h6
-rw-r--r--mail/em-filter-rule.c112
-rw-r--r--mail/em-filter-rule.h12
-rw-r--r--mail/em-filter-source-element.c52
-rw-r--r--mail/em-filter-source-element.h6
-rw-r--r--mail/em-folder-utils.c2
-rw-r--r--mail/em-search-context.c30
-rw-r--r--mail/em-search-context.h8
-rw-r--r--mail/em-utils.c8
-rw-r--r--mail/em-vfolder-context.c36
-rw-r--r--mail/em-vfolder-context.h6
-rw-r--r--mail/em-vfolder-editor.c22
-rw-r--r--mail/em-vfolder-editor.h6
-rw-r--r--mail/em-vfolder-rule.c52
-rw-r--r--mail/em-vfolder-rule.h6
-rw-r--r--mail/mail-autofilter.c140
-rw-r--r--mail/mail-autofilter.h8
-rw-r--r--mail/mail-ops.c4
-rw-r--r--mail/mail-send-recv.c12
-rw-r--r--mail/mail-session.c20
-rw-r--r--mail/mail-tools.c4
-rw-r--r--mail/mail-vfolder.c102
-rw-r--r--mail/mail-vfolder.h8
29 files changed, 428 insertions, 425 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 26c4052736..3cfc3b3e87 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -30,7 +30,7 @@
#include <camel/camel-vee-store.h>
#include "e-util/e-error.h"
-#include "filter/filter-rule.h"
+#include "filter/e-filter-rule.h"
#include "mail/e-mail-browser.h"
#include "mail/em-composer-utils.h"
@@ -509,11 +509,11 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader,
folder_uri = message_list->folder_uri;
if (em_utils_folder_is_sent (folder, folder_uri))
- filter_source = FILTER_SOURCE_OUTGOING;
+ filter_source = E_FILTER_SOURCE_OUTGOING;
else if (em_utils_folder_is_outbox (folder, folder_uri))
- filter_source = FILTER_SOURCE_OUTGOING;
+ filter_source = E_FILTER_SOURCE_OUTGOING;
else
- filter_source = FILTER_SOURCE_INCOMING;
+ filter_source = E_FILTER_SOURCE_INCOMING;
uids = message_list_get_selected (message_list);
diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c
index 4817d896b5..7c17e694e8 100644
--- a/mail/em-filter-context.c
+++ b/mail/em-filter-context.c
@@ -29,8 +29,8 @@
#include "em-filter-context.h"
#include "em-filter-rule.h"
-#include "filter/filter-option.h"
-#include "filter/filter-int.h"
+#include "filter/e-filter-option.h"
+#include "filter/e-filter-int.h"
#include "em-filter-source-element.h"
/* For poking into filter-folder guts */
@@ -42,11 +42,11 @@ static void em_filter_context_class_init(EMFilterContextClass *klass);
static void em_filter_context_init(EMFilterContext *fc);
static void em_filter_context_finalise(GObject *obj);
-static GList *filter_rename_uri(RuleContext *rc, const gchar *olduri, const gchar *newuri, GCompareFunc cmp);
-static GList *filter_delete_uri(RuleContext *rc, const gchar *uri, GCompareFunc cmp);
-static FilterElement *filter_new_element(RuleContext *rc, const gchar *name);
+static GList *filter_rename_uri(ERuleContext *rc, const gchar *olduri, const gchar *newuri, GCompareFunc cmp);
+static GList *filter_delete_uri(ERuleContext *rc, const gchar *uri, GCompareFunc cmp);
+static EFilterElement *filter_new_element(ERuleContext *rc, const gchar *name);
-static RuleContextClass *parent_class = NULL;
+static ERuleContextClass *parent_class = NULL;
GType
em_filter_context_get_type(void)
@@ -66,7 +66,7 @@ em_filter_context_get_type(void)
(GInstanceInitFunc) em_filter_context_init,
};
- type = g_type_register_static(RULE_TYPE_CONTEXT, "EMFilterContext", &info, 0);
+ type = g_type_register_static(E_TYPE_RULE_CONTEXT, "EMFilterContext", &info, 0);
}
return type;
@@ -76,9 +76,9 @@ static void
em_filter_context_class_init(EMFilterContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- RuleContextClass *rc_class = RULE_CONTEXT_CLASS(klass);
+ ERuleContextClass *rc_class = E_RULE_CONTEXT_CLASS(klass);
- parent_class = g_type_class_ref(RULE_TYPE_CONTEXT);
+ parent_class = g_type_class_ref(E_TYPE_RULE_CONTEXT);
object_class->finalize = em_filter_context_finalise;
@@ -91,14 +91,14 @@ em_filter_context_class_init(EMFilterContextClass *klass)
static void
em_filter_context_init(EMFilterContext *fc)
{
- rule_context_add_part_set((RuleContext *) fc, "partset", filter_part_get_type(),
- rule_context_add_part, rule_context_next_part);
- rule_context_add_part_set((RuleContext *) fc, "actionset", filter_part_get_type(),
- (RCPartFunc) em_filter_context_add_action,
- (RCNextPartFunc) em_filter_context_next_action);
-
- rule_context_add_rule_set((RuleContext *) fc, "ruleset", em_filter_rule_get_type(),
- (RCRuleFunc) rule_context_add_rule, rule_context_next_rule);
+ e_rule_context_add_part_set((ERuleContext *) fc, "partset", e_filter_part_get_type(),
+ e_rule_context_add_part, e_rule_context_next_part);
+ e_rule_context_add_part_set((ERuleContext *) fc, "actionset", e_filter_part_get_type(),
+ (ERuleContextPartFunc) em_filter_context_add_action,
+ (ERuleContextNextPartFunc) em_filter_context_next_action);
+
+ e_rule_context_add_rule_set((ERuleContext *) fc, "ruleset", em_filter_rule_get_type(),
+ (ERuleContextRuleFunc) e_rule_context_add_rule, e_rule_context_next_rule);
}
static void
@@ -126,44 +126,44 @@ em_filter_context_new(void)
}
void
-em_filter_context_add_action(EMFilterContext *fc, FilterPart *action)
+em_filter_context_add_action(EMFilterContext *fc, EFilterPart *action)
{
d(printf("find action : "));
fc->actions = g_list_append(fc->actions, action);
}
-FilterPart *
+EFilterPart *
em_filter_context_find_action(EMFilterContext *fc, const gchar *name)
{
d(printf("find action : "));
- return filter_part_find_list(fc->actions, name);
+ return e_filter_part_find_list(fc->actions, name);
}
-FilterPart *
+EFilterPart *
em_filter_context_create_action(EMFilterContext *fc, const gchar *name)
{
- FilterPart *part;
+ EFilterPart *part;
if ((part = em_filter_context_find_action(fc, name)))
- return filter_part_clone(part);
+ return e_filter_part_clone(part);
return NULL;
}
-FilterPart *
-em_filter_context_next_action(EMFilterContext *fc, FilterPart *last)
+EFilterPart *
+em_filter_context_next_action(EMFilterContext *fc, EFilterPart *last)
{
- return filter_part_next_list(fc->actions, last);
+ return e_filter_part_next_list(fc->actions, last);
}
/* We search for any folders in our actions list that need updating, update them */
static GList *
-filter_rename_uri(RuleContext *rc, const gchar *olduri, const gchar *newuri, GCompareFunc cmp)
+filter_rename_uri(ERuleContext *rc, const gchar *olduri, const gchar *newuri, GCompareFunc cmp)
{
- FilterRule *rule;
+ EFilterRule *rule;
GList *l, *el;
- FilterPart *action;
- FilterElement *element;
+ EFilterPart *action;
+ EFilterElement *element;
gint count = 0;
GList *changed = NULL;
@@ -172,7 +172,7 @@ filter_rename_uri(RuleContext *rc, const gchar *olduri, const gchar *newuri, GCo
/* For all rules, for all actions, for all elements, rename any folder elements */
/* Yes we could do this inside each part itself, but not today */
rule = NULL;
- while ((rule = rule_context_next_rule(rc, rule, NULL))) {
+ while ((rule = e_rule_context_next_rule(rc, rule, NULL))) {
gint rulecount = 0;
d(printf("checking rule '%s'\n", rule->name));
@@ -206,7 +206,7 @@ filter_rename_uri(RuleContext *rc, const gchar *olduri, const gchar *newuri, GCo
if (rulecount) {
changed = g_list_append(changed, g_strdup(rule->name));
- filter_rule_emit_changed(rule);
+ e_filter_rule_emit_changed(rule);
}
count += rulecount;
@@ -218,15 +218,15 @@ filter_rename_uri(RuleContext *rc, const gchar *olduri, const gchar *newuri, GCo
}
static GList *
-filter_delete_uri(RuleContext *rc, const gchar *uri, GCompareFunc cmp)
+filter_delete_uri(ERuleContext *rc, const gchar *uri, GCompareFunc cmp)
{
/* We basically do similar to above, but when we find it,
Remove the action, and if thats the last action, this might create an empty rule? remove the rule? */
- FilterRule *rule;
+ EFilterRule *rule;
GList *l, *el;
- FilterPart *action;
- FilterElement *element;
+ EFilterPart *action;
+ EFilterElement *element;
gint count = 0;
GList *deleted = NULL;
@@ -235,7 +235,7 @@ filter_delete_uri(RuleContext *rc, const gchar *uri, GCompareFunc cmp)
/* For all rules, for all actions, for all elements, check deleted folder elements */
/* Yes we could do this inside each part itself, but not today */
rule = NULL;
- while ((rule = rule_context_next_rule(rc, rule, NULL))) {
+ while ((rule = e_rule_context_next_rule(rc, rule, NULL))) {
gint recorded = 0;
d(printf("checking rule '%s'\n", rule->name));
@@ -281,17 +281,17 @@ filter_delete_uri(RuleContext *rc, const gchar *uri, GCompareFunc cmp)
return deleted;
}
-static FilterElement *
-filter_new_element(RuleContext *rc, const gchar *type)
+static EFilterElement *
+filter_new_element(ERuleContext *rc, const gchar *type)
{
if (!strcmp(type, "folder")) {
- return (FilterElement *) em_filter_folder_element_new();
+ return (EFilterElement *) em_filter_folder_element_new();
} else if (!strcmp(type, "system-flag")) {
- return (FilterElement *) filter_option_new();
+ return (EFilterElement *) e_filter_option_new();
} else if (!strcmp(type, "score")) {
- return (FilterElement *) filter_int_new_type("score", -3, 3);
+ return (EFilterElement *) e_filter_int_new_type("score", -3, 3);
} else if (!strcmp(type, "source")) {
- return (FilterElement *) em_filter_source_element_new();
+ return (EFilterElement *) em_filter_source_element_new();
} else {
return parent_class->new_element(rc, type);
}
diff --git a/mail/em-filter-context.h b/mail/em-filter-context.h
index 31431b4a34..d5eda2ab21 100644
--- a/mail/em-filter-context.h
+++ b/mail/em-filter-context.h
@@ -25,7 +25,7 @@
#ifndef _EM_FILTER_CONTEXT_H
#define _EM_FILTER_CONTEXT_H
-#include "filter/rule-context.h"
+#include "filter/e-rule-context.h"
#define EM_TYPE_FILTER_CONTEXT (em_filter_context_get_type ())
#define EM_FILTER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FILTER_TYPE_CONTEXT, EMFilterContext))
@@ -38,22 +38,22 @@ typedef struct _EMFilterContext EMFilterContext;
typedef struct _EMFilterContextClass EMFilterContextClass;
struct _EMFilterContext {
- RuleContext parent_object;
+ ERuleContext parent_object;
GList *actions;
};
struct _EMFilterContextClass {
- RuleContextClass parent_class;
+ ERuleContextClass parent_class;
};
GType em_filter_context_get_type (void);
EMFilterContext *em_filter_context_new (void);
/* methods */
-void em_filter_context_add_action (EMFilterContext *fc, FilterPart *action);
-FilterPart *em_filter_context_find_action (EMFilterContext *fc, const gchar *name);
-FilterPart *em_filter_context_create_action (EMFilterContext *fc, const gchar *name);
-FilterPart *em_filter_context_next_action (EMFilterContext *fc, FilterPart *last);
+void em_filter_context_add_action (EMFilterContext *fc, EFilterPart *action);
+EFilterPart *em_filter_context_find_action (EMFilterContext *fc, const gchar *name);
+EFilterPart *em_filter_context_create_action (EMFilterContext *fc, const gchar *name);
+EFilterPart *em_filter_context_next_action (EMFilterContext *fc, EFilterPart *last);
#endif /* ! _EM_FILTER_CONTEXT_H */
diff --git a/mail/em-filter-editor.c b/mail/em-filter-editor.c
index f4271bf6e0..c0e5725e77 100644
--- a/mail/em-filter-editor.c
+++ b/mail/em-filter-editor.c
@@ -36,20 +36,20 @@
static gpointer parent_class;
-static FilterRule *
-filter_editor_create_rule (RuleEditor *rule_editor)
+static EFilterRule *
+filter_editor_create_rule (ERuleEditor *rule_editor)
{
- FilterRule *rule = filter_rule_new ();
- FilterPart *part;
+ EFilterRule *rule = e_filter_rule_new ();
+ EFilterPart *part;
/* create a rule with 1 part & 1 action in it */
- rule = (FilterRule *)em_filter_rule_new ();
- part = rule_context_next_part (rule_editor->context, NULL);
- filter_rule_add_part (rule, filter_part_clone (part));
+ rule = (EFilterRule *)em_filter_rule_new ();
+ part = e_rule_context_next_part (rule_editor->context, NULL);
+ e_filter_rule_add_part (rule, e_filter_part_clone (part));
part = em_filter_context_next_action (
(EMFilterContext *)rule_editor->context, NULL);
em_filter_rule_add_action (
- (EMFilterRule *)rule, filter_part_clone (part));
+ (EMFilterRule *)rule, e_filter_part_clone (part));
return rule;
}
@@ -57,11 +57,11 @@ filter_editor_create_rule (RuleEditor *rule_editor)
static void
filter_editor_class_init (EMFilterEditorClass *class)
{
- RuleEditorClass *rule_editor_class;
+ ERuleEditorClass *rule_editor_class;
parent_class = g_type_class_peek_parent (class);
- rule_editor_class = RULE_EDITOR_CLASS (class);
+ rule_editor_class = E_RULE_EDITOR_CLASS (class);
rule_editor_class->create_rule = filter_editor_create_rule;
}
@@ -98,7 +98,7 @@ em_filter_editor_get_type (void)
};
type = g_type_register_static (
- RULE_TYPE_EDITOR, "EMFilterEditor", &type_info, 0);
+ E_TYPE_RULE_EDITOR, "EMFilterEditor", &type_info, 0);
}
return type;
@@ -158,7 +158,7 @@ select_source (GtkComboBox *combobox, EMFilterEditor *fe)
source = (gchar *) (g_slist_nth (sources, idx))->data;
g_return_if_fail (source);
- rule_editor_set_source ((RuleEditor *)fe, source);
+ e_rule_editor_set_source ((ERuleEditor *)fe, source);
}
void
@@ -185,9 +185,9 @@ em_filter_editor_construct (EMFilterEditor *fe,
g_object_set_data_full (G_OBJECT (combobox), "sources", sources, free_sources);
gtk_widget_show (combobox);
- rule_editor_construct ((RuleEditor *) fe, (RuleContext *) fc, gui, source_names[0].source, _("_Filter Rules"));
+ e_rule_editor_construct ((ERuleEditor *) fe, (ERuleContext *) fc, gui, source_names[0].source, _("_Filter Rules"));
/* Show the Enabled column, we support it here */
- column = gtk_tree_view_get_column (GTK_TREE_VIEW (RULE_EDITOR (fe)->list), 0);
+ column = gtk_tree_view_get_column (GTK_TREE_VIEW (E_RULE_EDITOR (fe)->list), 0);
gtk_tree_view_column_set_visible (column, TRUE);
}
diff --git a/mail/em-filter-editor.h b/mail/em-filter-editor.h
index c725fd97b5..e70b346d02 100644
--- a/mail/em-filter-editor.h
+++ b/mail/em-filter-editor.h
@@ -25,7 +25,7 @@
#ifndef EM_FILTER_EDITOR_H
#define EM_FILTER_EDITOR_H
-#include "filter/rule-editor.h"
+#include "filter/e-rule-editor.h"
#include "em-filter-context.h"
/* Standard GObject macros */
@@ -60,11 +60,11 @@ struct _EMFilterSource {
};
struct _EMFilterEditor {
- RuleEditor parent;
+ ERuleEditor parent;
};
struct _EMFilterEditorClass {
- RuleEditorClass parent_class;
+ ERuleEditorClass parent_class;
};
GType em_filter_editor_get_type (void);
diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c
index 8e07ef9c8c..b705bbde25 100644
--- a/mail/em-filter-folder-element.c
+++ b/mail/em-filter-folder-element.c
@@ -34,26 +34,27 @@
#include "em-filter-folder-element.h"
#include "mail/em-folder-selection-button.h"
#include "mail/em-utils.h"
+#include "filter/e-filter-part.h"
#include "libedataserver/e-sexp.h"
#include "e-util/e-error.h"
#define d(x)
-static gboolean validate(FilterElement *fe, GtkWindow *error_parent);
-static gint folder_eq(FilterElement *fe, FilterElement *cm);
-static void xml_create(FilterElement *fe, xmlNodePtr node);
-static xmlNodePtr xml_encode(FilterElement *fe);
-static gint xml_decode(FilterElement *fe, xmlNodePtr node);
-static GtkWidget *get_widget(FilterElement *fe);
-static void build_code(FilterElement *fe, GString *out, struct _FilterPart *ff);
-static void format_sexp(FilterElement *, GString *);
-static void emff_copy_value(FilterElement *de, FilterElement *se);
+static gboolean validate(EFilterElement *fe, GtkWindow *error_parent);
+static gint folder_eq(EFilterElement *fe, EFilterElement *cm);
+static void xml_create(EFilterElement *fe, xmlNodePtr node);
+static xmlNodePtr xml_encode(EFilterElement *fe);
+static gint xml_decode(EFilterElement *fe, xmlNodePtr node);
+static GtkWidget *get_widget(EFilterElement *fe);
+static void build_code(EFilterElement *fe, GString *out, EFilterPart *ff);
+static void format_sexp(EFilterElement *, GString *);
+static void emff_copy_value(EFilterElement *de, EFilterElement *se);
static void em_filter_folder_element_class_init(EMFilterFolderElementClass *class);
static void em_filter_folder_element_init(EMFilterFolderElement *ff);
static void em_filter_folder_element_finalise(GObject *obj);
-static FilterElementClass *parent_class = NULL;
+static EFilterElementClass *parent_class = NULL;
GType
em_filter_folder_element_get_type(void)
@@ -73,7 +74,7 @@ em_filter_folder_element_get_type(void)
(GInstanceInitFunc)em_filter_folder_element_init,
};
- type = g_type_register_static(FILTER_TYPE_ELEMENT, "EMFilterFolderElement", &info, 0);
+ type = g_type_register_static(E_TYPE_FILTER_ELEMENT, "EMFilterFolderElement", &info, 0);
}
return type;
@@ -83,9 +84,9 @@ static void
em_filter_folder_element_class_init(EMFilterFolderElementClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- FilterElementClass *fe_class = FILTER_ELEMENT_CLASS(klass);
+ EFilterElementClass *fe_class = E_FILTER_ELEMENT_CLASS(klass);
- parent_class = g_type_class_ref(FILTER_TYPE_ELEMENT);
+ parent_class = g_type_class_ref(E_TYPE_FILTER_ELEMENT);
object_class->finalize = em_filter_folder_element_finalise;
@@ -138,7 +139,7 @@ em_filter_folder_element_set_value(EMFilterFolderElement *ff, const gchar *uri)
}
static gboolean
-validate(FilterElement *fe, GtkWindow *error_parent)
+validate(EFilterElement *fe, GtkWindow *error_parent)
{
EMFilterFolderElement *ff = (EMFilterFolderElement *)fe;
@@ -152,21 +153,21 @@ validate(FilterElement *fe, GtkWindow *error_parent)
}
static gint
-folder_eq(FilterElement *fe, FilterElement *cm)
+folder_eq(EFilterElement *fe, EFilterElement *cm)
{
- return FILTER_ELEMENT_CLASS(parent_class)->eq(fe, cm)
+ return E_FILTER_ELEMENT_CLASS(parent_class)->eq(fe, cm)
&& strcmp(((EMFilterFolderElement *)fe)->uri, ((EMFilterFolderElement *)cm)->uri)== 0;
}
static void
-xml_create(FilterElement *fe, xmlNodePtr node)
+xml_create(EFilterElement *fe, xmlNodePtr node)
{
/* parent implementation */
- FILTER_ELEMENT_CLASS(parent_class)->xml_create(fe, node);
+ E_FILTER_ELEMENT_CLASS(parent_class)->xml_create(fe, node);
}
static xmlNodePtr
-xml_encode(FilterElement *fe)
+xml_encode(EFilterElement *fe)
{
xmlNodePtr value, work;
EMFilterFolderElement *ff = (EMFilterFolderElement *)fe;
@@ -187,7 +188,7 @@ xml_encode(FilterElement *fe)
}
static gint
-xml_decode(FilterElement *fe, xmlNodePtr node)
+xml_decode(EFilterElement *fe, xmlNodePtr node)
{
EMFilterFolderElement *ff = (EMFilterFolderElement *)fe;
xmlNodePtr n;
@@ -240,7 +241,7 @@ folder_selected(EMFolderSelectionButton *button, EMFilterFolderElement *ff)
}
static GtkWidget *
-get_widget(FilterElement *fe)
+get_widget(EFilterElement *fe)
{
EMFilterFolderElement *ff = (EMFilterFolderElement *)fe;
GtkWidget *button;
@@ -266,13 +267,13 @@ get_widget(FilterElement *fe)
}
static void
-build_code(FilterElement *fe, GString *out, struct _FilterPart *ff)
+build_code(EFilterElement *fe, GString *out, EFilterPart *ff)
{
return;
}
static void
-format_sexp(FilterElement *fe, GString *out)
+format_sexp(EFilterElement *fe, GString *out)
{
EMFilterFolderElement *ff = (EMFilterFolderElement *)fe;
@@ -280,7 +281,7 @@ format_sexp(FilterElement *fe, GString *out)
}
static void
-emff_copy_value(FilterElement *de, FilterElement *se)
+emff_copy_value(EFilterElement *de, EFilterElement *se)
{
if (EM_IS_FILTER_FOLDER_ELEMENT(se)) {
((EMFilterFolderElement *)de)->store_camel_uri = ((EMFilterFolderElement *)se)->store_camel_uri;
diff --git a/mail/em-filter-folder-element.h b/mail/em-filter-folder-element.h
index 149d0226e7..02fb34b09f 100644
--- a/mail/em-filter-folder-element.h
+++ b/mail/em-filter-folder-element.h
@@ -25,7 +25,7 @@
#ifndef _EM_FILTER_FOLDER_ELEMENT_H
#define _EM_FILTER_FOLDER_ELEMENT_H
-#include "filter/filter-element.h"
+#include "filter/e-filter-element.h"
#define EM_FILTER_FOLDER_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_filter_folder_element_get_type(), EMFilterFolderElement))
#define EM_FILTER_FOLDER_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_filter_folder_element_get_type(), EMFilterFolderElementClass))
@@ -37,14 +37,14 @@ typedef struct _EMFilterFolderElement EMFilterFolderElement;
typedef struct _EMFilterFolderElementClass EMFilterFolderElementClass;
struct _EMFilterFolderElement {
- FilterElement parent_object;
+ EFilterElement parent_object;
gchar *uri;
gboolean store_camel_uri; /* true if uri should contain camel uri, otherwise contains evolution's uri with an Account ID */
};
struct _EMFilterFolderElementClass {
- FilterElementClass parent_class;
+ EFilterElementClass parent_class;
};
GType em_filter_folder_element_get_type (void);
diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c
index 8e95800e7a..d655e804be 100644
--- a/mail/em-filter-rule.c
+++ b/mail/em-filter-rule.c
@@ -35,19 +35,19 @@
#define d(x)
-static gint validate(FilterRule *fr, GtkWindow *error_parent);
-static gint filter_eq(FilterRule *fr, FilterRule *cm);
-static xmlNodePtr xml_encode(FilterRule *fr);
-static gint xml_decode(FilterRule *fr, xmlNodePtr, RuleContext *rc);
-static void rule_copy(FilterRule *dest, FilterRule *src);
-/*static void build_code(FilterRule *, GString *out);*/
-static GtkWidget *get_widget(FilterRule *fr, RuleContext *rc);
+static gint validate(EFilterRule *fr, GtkWindow *error_parent);
+static gint filter_eq(EFilterRule *fr, EFilterRule *cm);
+static xmlNodePtr xml_encode(EFilterRule *fr);
+static gint xml_decode(EFilterRule *fr, xmlNodePtr, ERuleContext *rc);
+static void rule_copy(EFilterRule *dest, EFilterRule *src);
+/*static void build_code(EFilterRule *, GString *out);*/
+static GtkWidget *get_widget(EFilterRule *fr, ERuleContext *rc);
static void em_filter_rule_class_init(EMFilterRuleClass *klass);
static void em_filter_rule_init(EMFilterRule *ff);
static void em_filter_rule_finalise(GObject *obj);
-static FilterRuleClass *parent_class = NULL;
+static EFilterRuleClass *parent_class = NULL;
GType
em_filter_rule_get_type(void)
@@ -67,7 +67,7 @@ em_filter_rule_get_type(void)
(GInstanceInitFunc)em_filter_rule_init,
};
- type = g_type_register_static(FILTER_TYPE_RULE, "EMFilterRule", &info, 0);
+ type = g_type_register_static(E_TYPE_FILTER_RULE, "EMFilterRule", &info, 0);
}
return type;
@@ -77,9 +77,9 @@ static void
em_filter_rule_class_init(EMFilterRuleClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- FilterRuleClass *fr_class =(FilterRuleClass *)klass;
+ EFilterRuleClass *fr_class =(EFilterRuleClass *)klass;
- parent_class = g_type_class_ref(FILTER_TYPE_RULE);
+ parent_class = g_type_class_ref(E_TYPE_FILTER_RULE);
object_class->finalize = em_filter_rule_finalise;
@@ -133,23 +133,23 @@ em_filter_rule_new(void)
}
void
-em_filter_rule_add_action(EMFilterRule *fr, FilterPart *fp)
+em_filter_rule_add_action(EMFilterRule *fr, EFilterPart *fp)
{
fr->actions = g_list_append(fr->actions, fp);
- filter_rule_emit_changed((FilterRule *)fr);
+ e_filter_rule_emit_changed((EFilterRule *)fr);
}
void
-em_filter_rule_remove_action(EMFilterRule *fr, FilterPart *fp)
+em_filter_rule_remove_action(EMFilterRule *fr, EFilterPart *fp)
{
fr->actions = g_list_remove(fr->actions, fp);
- filter_rule_emit_changed((FilterRule *)fr);
+ e_filter_rule_emit_changed((EFilterRule *)fr);
}
void
-em_filter_rule_replace_action(EMFilterRule *fr, FilterPart *fp, FilterPart *new)
+em_filter_rule_replace_action(EMFilterRule *fr, EFilterPart *fp, EFilterPart *new)
{
GList *l;
@@ -160,30 +160,30 @@ em_filter_rule_replace_action(EMFilterRule *fr, FilterPart *fp, FilterPart *new)
fr->actions = g_list_append(fr->actions, new);
}
- filter_rule_emit_changed((FilterRule *)fr);
+ e_filter_rule_emit_changed((EFilterRule *)fr);
}
void
em_filter_rule_build_action(EMFilterRule *fr, GString *out)
{
g_string_append(out, "(begin\n");
- filter_part_build_code_list(fr->actions, out);
+ e_filter_part_build_code_list(fr->actions, out);
g_string_append(out, ")\n");
}
static gint
-validate(FilterRule *fr, GtkWindow *error_parent)
+validate(EFilterRule *fr, GtkWindow *error_parent)
{
EMFilterRule *ff =(EMFilterRule *)fr;
GList *parts;
gint valid;
- valid = FILTER_RULE_CLASS(parent_class)->validate (fr, error_parent);
+ valid = E_FILTER_RULE_CLASS(parent_class)->validate (fr, error_parent);
/* validate rule actions */
parts = ff->actions;
while (parts && valid) {
- valid = filter_part_validate ((FilterPart *)parts->data, error_parent);
+ valid = e_filter_part_validate ((EFilterPart *)parts->data, error_parent);
parts = parts->next;
}
@@ -196,9 +196,9 @@ list_eq(GList *al, GList *bl)
gint truth = TRUE;
while (truth && al && bl) {
- FilterPart *a = al->data, *b = bl->data;
+ EFilterPart *a = al->data, *b = bl->data;
- truth = filter_part_eq(a, b);
+ truth = e_filter_part_eq(a, b);
al = al->next;
bl = bl->next;
}
@@ -207,26 +207,26 @@ list_eq(GList *al, GList *bl)
}
static gint
-filter_eq(FilterRule *fr, FilterRule *cm)
+filter_eq(EFilterRule *fr, EFilterRule *cm)
{
- return FILTER_RULE_CLASS(parent_class)->eq(fr, cm)
+ return E_FILTER_RULE_CLASS(parent_class)->eq(fr, cm)
&& list_eq(((EMFilterRule *)fr)->actions,((EMFilterRule *)cm)->actions);
}
static xmlNodePtr
-xml_encode(FilterRule *fr)
+xml_encode(EFilterRule *fr)
{
EMFilterRule *ff =(EMFilterRule *)fr;
xmlNodePtr node, set, work;
GList *l;
- node = FILTER_RULE_CLASS(parent_class)->xml_encode(fr);
+ node = E_FILTER_RULE_CLASS(parent_class)->xml_encode(fr);
g_return_val_if_fail (node != NULL, NULL);
set = xmlNewNode(NULL, (const guchar *)"actionset");
xmlAddChild(node, set);
l = ff->actions;
while (l) {
- work = filter_part_xml_encode((FilterPart *)l->data);
+ work = e_filter_part_xml_encode((EFilterPart *)l->data);
xmlAddChild(set, work);
l = l->next;
}
@@ -236,11 +236,11 @@ xml_encode(FilterRule *fr)
}
static void
-load_set(xmlNodePtr node, EMFilterRule *ff, RuleContext *rc)
+load_set(xmlNodePtr node, EMFilterRule *ff, ERuleContext *rc)
{
xmlNodePtr work;
gchar *rulename;
- FilterPart *part;
+ EFilterPart *part;
work = node->children;
while (work) {
@@ -248,8 +248,8 @@ load_set(xmlNodePtr node, EMFilterRule *ff, RuleContext *rc)
rulename = (gchar *)xmlGetProp(work, (const guchar *)"name");
part = em_filter_context_find_action((EMFilterContext *)rc, rulename);
if (part) {
- part = filter_part_clone(part);
- filter_part_xml_decode(part, work);
+ part = e_filter_part_clone(part);
+ e_filter_part_xml_decode(part, work);
em_filter_rule_add_action(ff, part);
} else {
g_warning("cannot find rule part '%s'\n", rulename);
@@ -263,13 +263,13 @@ load_set(xmlNodePtr node, EMFilterRule *ff, RuleContext *rc)
}
static gint
-xml_decode(FilterRule *fr, xmlNodePtr node, RuleContext *rc)
+xml_decode(EFilterRule *fr, xmlNodePtr node, ERuleContext *rc)
{
EMFilterRule *ff =(EMFilterRule *)fr;
xmlNodePtr work;
gint result;
- result = FILTER_RULE_CLASS(parent_class)->xml_decode(fr, node, rc);
+ result = E_FILTER_RULE_CLASS(parent_class)->xml_decode(fr, node, rc);
if (result != 0)
return result;
@@ -285,7 +285,7 @@ xml_decode(FilterRule *fr, xmlNodePtr node, RuleContext *rc)
}
static void
-rule_copy(FilterRule *dest, FilterRule *src)
+rule_copy(EFilterRule *dest, EFilterRule *src)
{
EMFilterRule *fdest, *fsrc;
GList *node;
@@ -301,33 +301,33 @@ rule_copy(FilterRule *dest, FilterRule *src)
node = fsrc->actions;
while (node) {
- FilterPart *part = node->data;
+ EFilterPart *part = node->data;
g_object_ref(part);
fdest->actions = g_list_append(fdest->actions, part);
node = node->next;
}
- FILTER_RULE_CLASS(parent_class)->copy(dest, src);
+ E_FILTER_RULE_CLASS(parent_class)->copy(dest, src);
}
-/*static void build_code(FilterRule *fr, GString *out)
+/*static void build_code(EFilterRule *fr, GString *out)
{
return FILTER_RULE_CLASS(parent_class)->build_code(fr, out);
}*/
struct _part_data {
- FilterRule *fr;
+ EFilterRule *fr;
EMFilterContext *f;
- FilterPart *part;
+ EFilterPart *part;
GtkWidget *partwidget, *container;
};
static void
part_combobox_changed (GtkComboBox *combobox, struct _part_data *data)
{
- FilterPart *part = NULL;
- FilterPart *newpart;
+ EFilterPart *part = NULL;
+ EFilterPart *newpart;
gint index, i;
index = gtk_combo_box_get_active (combobox);
@@ -347,20 +347,20 @@ part_combobox_changed (GtkComboBox *combobox, struct _part_data *data)
if (data->partwidget)
gtk_container_remove (GTK_CONTAINER (data->container), data->partwidget);
- newpart = filter_part_clone (part);
- filter_part_copy_values (newpart, data->part);
+ newpart = e_filter_part_clone (part);
+ e_filter_part_copy_values (newpart, data->part);
em_filter_rule_replace_action ((EMFilterRule *)data->fr, data->part, newpart);
g_object_unref (data->part);
data->part = newpart;
- data->partwidget = filter_part_get_widget (newpart);
+ data->partwidget = e_filter_part_get_widget (newpart);
if (data->partwidget)
gtk_box_pack_start (GTK_BOX (data->container), data->partwidget, TRUE, TRUE, 0);
}
static GtkWidget *
-get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr)
+get_rule_part_widget(EMFilterContext *f, EFilterPart *newpart, EFilterRule *fr)
{
- FilterPart *part = NULL;
+ EFilterPart *part = NULL;
GtkWidget *combobox;
GtkWidget *hbox;
GtkWidget *p;
@@ -373,7 +373,7 @@ get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr)
data->part = newpart;
hbox = gtk_hbox_new(FALSE, 0);
- p = filter_part_get_widget(newpart);
+ p = e_filter_part_get_widget(newpart);
data->partwidget = p;
data->container = hbox;
@@ -402,7 +402,7 @@ get_rule_part_widget(EMFilterContext *f, FilterPart *newpart, FilterRule *fr)
}
struct _rule_data {
- FilterRule *fr;
+ EFilterRule *fr;
EMFilterContext *f;
GtkWidget *parts;
};
@@ -410,7 +410,7 @@ struct _rule_data {
static void
less_parts(GtkWidget *button, struct _rule_data *data)
{
- FilterPart *part;
+ EFilterPart *part;
GtkWidget *rule;
GList *l;
@@ -431,7 +431,7 @@ less_parts(GtkWidget *button, struct _rule_data *data)
}
static void
-attach_rule(GtkWidget *rule, struct _rule_data *data, FilterPart *part, gint row)
+attach_rule(GtkWidget *rule, struct _rule_data *data, EFilterPart *part, gint row)
{
GtkWidget *remove;
@@ -465,7 +465,7 @@ do_grab_focus_cb (GtkWidget *widget, gpointer data)
static void
more_parts(GtkWidget *button, struct _rule_data *data)
{
- FilterPart *new;
+ EFilterPart *new;
/* create a new rule entry, use the first type of rule */
new = em_filter_context_next_action((EMFilterContext *)data->f, NULL);
@@ -473,7 +473,7 @@ more_parts(GtkWidget *button, struct _rule_data *data)
GtkWidget *w;
guint16 rows;
- new = filter_part_clone(new);
+ new = e_filter_part_clone(new);
em_filter_rule_add_action((EMFilterRule *)data->fr, new);
w = get_rule_part_widget(data->f, new, data->fr);
@@ -502,20 +502,20 @@ more_parts(GtkWidget *button, struct _rule_data *data)
}
static GtkWidget *
-get_widget(FilterRule *fr, RuleContext *rc)
+get_widget(EFilterRule *fr, ERuleContext *rc)
{
GtkWidget *widget, *hbox, *add, *label;
GtkWidget *parts, *inframe, *w;
GtkWidget *scrolledwindow;
GtkObject *hadj, *vadj;
GList *l;
- FilterPart *part;
+ EFilterPart *part;
struct _rule_data *data;
EMFilterRule *ff =(EMFilterRule *)fr;
gint rows, i = 0;
gchar *msg;
- widget = FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc);
+ widget = E_FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc);
/* and now for the action area */
msg = g_strdup_printf("<b>%s</b>", _("Then"));
diff --git a/mail/em-filter-rule.h b/mail/em-filter-rule.h
index 6ddaddc8d2..4ea49780b9 100644
--- a/mail/em-filter-rule.h
+++ b/mail/em-filter-rule.h
@@ -25,7 +25,7 @@
#ifndef _EM_FILTER_RULE_H
#define _EM_FILTER_RULE_H
-#include "filter/filter-rule.h"
+#include "filter/e-filter-rule.h"
#define EM_FILTER_RULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_filter_rule_get_type(), EMFilterRule))
#define EM_FILTER_RULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_filter_rule_get_type(), EMFilterRuleClass))
@@ -37,22 +37,22 @@ typedef struct _EMFilterRule EMFilterRule;
typedef struct _EMFilterRuleClass EMFilterRuleClass;
struct _EMFilterRule {
- FilterRule parent_object;
+ EFilterRule parent_object;
GList *actions;
};
struct _EMFilterRuleClass {
- FilterRuleClass parent_class;
+ EFilterRuleClass parent_class;
};
GType em_filter_rule_get_type (void);
EMFilterRule *em_filter_rule_new (void);
/* methods */
-void em_filter_rule_add_action (EMFilterRule *fr, FilterPart *fp);
-void em_filter_rule_remove_action (EMFilterRule *fr, FilterPart *fp);
-void em_filter_rule_replace_action (EMFilterRule *fr, FilterPart *fp, FilterPart *new);
+void em_filter_rule_add_action (EMFilterRule *fr, EFilterPart *fp);
+void em_filter_rule_remove_action (EMFilterRule *fr, EFilterPart *fp);
+void em_filter_rule_replace_action (EMFilterRule *fr, EFilterPart *fp, EFilterPart *new);
void em_filter_rule_build_action (EMFilterRule *fr, GString *out);
diff --git a/mail/em-filter-source-element.c b/mail/em-filter-source-element.c
index 40af002d29..d080076725 100644
--- a/mail/em-filter-source-element.c
+++ b/mail/em-filter-source-element.c
@@ -34,18 +34,20 @@
#include <libedataserver/e-account-list.h>
#include <camel/camel-url.h>
+#include "filter/e-filter-part.h"
+
static void em_filter_source_element_class_init(EMFilterSourceElementClass *klass);
static void em_filter_source_element_init(EMFilterSourceElement *fs);
static void em_filter_source_element_finalize(GObject *obj);
-static gint source_eq(FilterElement *fe, FilterElement *cm);
-static void xml_create(FilterElement *fe, xmlNodePtr node);
-static xmlNodePtr xml_encode(FilterElement *fe);
-static gint xml_decode(FilterElement *fe, xmlNodePtr node);
-static FilterElement *clone(FilterElement *fe);
-static GtkWidget *get_widget(FilterElement *fe);
-static void build_code(FilterElement *fe, GString *out, struct _FilterPart *ff);
-static void format_sexp(FilterElement *, GString *);
+static gint source_eq(EFilterElement *fe, EFilterElement *cm);
+static void xml_create(EFilterElement *fe, xmlNodePtr node);
+static xmlNodePtr xml_encode(EFilterElement *fe);
+static gint xml_decode(EFilterElement *fe, xmlNodePtr node);
+static EFilterElement *clone(EFilterElement *fe);
+static GtkWidget *get_widget(EFilterElement *fe);
+static void build_code(EFilterElement *fe, GString *out, EFilterPart *ff);
+static void format_sexp(EFilterElement *, GString *);
static void em_filter_source_element_add_source (EMFilterSourceElement *fs, const gchar *account_name, const gchar *name,
const gchar *addr, const gchar *url);
@@ -63,7 +65,7 @@ struct _EMFilterSourceElementPrivate {
gchar *current_url;
};
-static FilterElementClass *parent_class = NULL;
+static EFilterElementClass *parent_class = NULL;
GType
em_filter_source_element_get_type(void)
@@ -83,7 +85,7 @@ em_filter_source_element_get_type(void)
(GInstanceInitFunc)em_filter_source_element_init,
};
- type = g_type_register_static(FILTER_TYPE_ELEMENT, "EMFilterSourceElement", &info, 0);
+ type = g_type_register_static(E_TYPE_FILTER_ELEMENT, "EMFilterSourceElement", &info, 0);
}
return type;
@@ -93,9 +95,9 @@ static void
em_filter_source_element_class_init(EMFilterSourceElementClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- FilterElementClass *fe_class = FILTER_ELEMENT_CLASS(klass);
+ EFilterElementClass *fe_class = E_FILTER_ELEMENT_CLASS(klass);
- parent_class = g_type_class_ref(FILTER_TYPE_ELEMENT);
+ parent_class = g_type_class_ref(E_TYPE_FILTER_ELEMENT);
object_class->finalize = em_filter_source_element_finalize;
@@ -149,25 +151,25 @@ em_filter_source_element_new(void)
}
static gint
-source_eq(FilterElement *fe, FilterElement *cm)
+source_eq(EFilterElement *fe, EFilterElement *cm)
{
EMFilterSourceElement *fs = (EMFilterSourceElement *)fe, *cs = (EMFilterSourceElement *)cm;
- return FILTER_ELEMENT_CLASS(parent_class)->eq(fe, cm)
+ return E_FILTER_ELEMENT_CLASS(parent_class)->eq(fe, cm)
&&((fs->priv->current_url && cs->priv->current_url
&& strcmp(fs->priv->current_url, cs->priv->current_url)== 0)
||(fs->priv->current_url == NULL && cs->priv->current_url == NULL));
}
static void
-xml_create(FilterElement *fe, xmlNodePtr node)
+xml_create(EFilterElement *fe, xmlNodePtr node)
{
/* Call parent implementation */
- FILTER_ELEMENT_CLASS(parent_class)->xml_create(fe, node);
+ E_FILTER_ELEMENT_CLASS(parent_class)->xml_create(fe, node);
}
static xmlNodePtr
-xml_encode(FilterElement *fe)
+xml_encode(EFilterElement *fe)
{
xmlNodePtr value;
@@ -184,7 +186,7 @@ xml_encode(FilterElement *fe)
}
static gint
-xml_decode(FilterElement *fe, xmlNodePtr node)
+xml_decode(EFilterElement *fe, xmlNodePtr node)
{
EMFilterSourceElement *fs = (EMFilterSourceElement *)fe;
CamelURL *url;
@@ -209,14 +211,14 @@ xml_decode(FilterElement *fe, xmlNodePtr node)
return 0;
}
-static FilterElement *
-clone(FilterElement *fe)
+static EFilterElement *
+clone(EFilterElement *fe)
{
EMFilterSourceElement *fs = (EMFilterSourceElement *)fe;
EMFilterSourceElement *cpy = em_filter_source_element_new();
GList *i;
- ((FilterElement *)cpy)->name = (gchar *)xmlStrdup((guchar *)fe->name);
+ ((EFilterElement *)cpy)->name = (gchar *)xmlStrdup((guchar *)fe->name);
cpy->priv->current_url = g_strdup(fs->priv->current_url);
@@ -225,7 +227,7 @@ clone(FilterElement *fe)
em_filter_source_element_add_source(cpy, info->account_name, info->name, info->address, info->url);
}
- return (FilterElement *)cpy;
+ return (EFilterElement *)cpy;
}
static void
@@ -245,7 +247,7 @@ source_changed(GtkComboBox *combobox, EMFilterSourceElement *fs)
}
static GtkWidget *
-get_widget(FilterElement *fe)
+get_widget(EFilterElement *fe)
{
EMFilterSourceElement *fs = (EMFilterSourceElement *)fe;
GtkWidget *combobox;
@@ -303,13 +305,13 @@ get_widget(FilterElement *fe)
}
static void
-build_code(FilterElement *fe, GString *out, struct _FilterPart *ff)
+build_code(EFilterElement *fe, GString *out, EFilterPart *ff)
{
/* We are doing nothing on purpose. */
}
static void
-format_sexp(FilterElement *fe, GString *out)
+format_sexp(EFilterElement *fe, GString *out)
{
EMFilterSourceElement *fs = (EMFilterSourceElement *)fe;
diff --git a/mail/em-filter-source-element.h b/mail/em-filter-source-element.h
index d4d6a75890..cb68552db2 100644
--- a/mail/em-filter-source-element.h
+++ b/mail/em-filter-source-element.h
@@ -24,7 +24,7 @@
#ifndef _EM_FILTER_SOURCE_ELEMENT_H
#define _EM_FILTER_SOURCE_ELEMENT_H
-#include "filter/filter-element.h"
+#include "filter/e-filter-element.h"
#define EM_FILTER_SOURCE_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_filter_source_element_get_type(), EMFilterSourceElement))
#define EM_FILTER_SOURCE_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_filter_source_element_get_type(), EMFilterSourceElementClass))
@@ -36,12 +36,12 @@ typedef struct _EMFilterSourceElement EMFilterSourceElement;
typedef struct _EMFilterSourceElementClass EMFilterSourceElementClass;
struct _EMFilterSourceElement {
- FilterElement parent_object;
+ EFilterElement parent_object;
struct _EMFilterSourceElementPrivate *priv;
};
struct _EMFilterSourceElementClass {
- FilterElementClass parent_class;
+ EFilterElementClass parent_class;
};
GType em_filter_source_element_get_type (void);
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index c2850daaf1..8b1dab9388 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -625,7 +625,7 @@ emfu_popup_new_folder_response (EMFolderSelector *emfs, gint response, gpointer
vfolder_load_storage ();
rule = em_vfolder_rule_new();
- filter_rule_set_name((FilterRule *)rule, path);
+ e_filter_rule_set_name((EFilterRule *)rule, path);
vfolder_gui_add_rule(rule);
gtk_widget_destroy((GtkWidget *)emfs);
} else {
diff --git a/mail/em-search-context.c b/mail/em-search-context.c
index 7bc43a18be..f4b817b6b6 100644
--- a/mail/em-search-context.c
+++ b/mail/em-search-context.c
@@ -29,44 +29,44 @@
#include <string.h>
#include "em-search-context.h"
-#include "filter/filter-rule.h"
-#include "filter/filter-option.h"
-#include "filter/filter-int.h"
+#include "filter/e-filter-rule.h"
+#include "filter/e-filter-option.h"
+#include "filter/e-filter-int.h"
static gpointer parent_class;
-static FilterElement *
-search_context_new_element (RuleContext *context,
+static EFilterElement *
+search_context_new_element (ERuleContext *context,
const gchar *type)
{
if (strcmp (type, "system-flag") == 0)
- return (FilterElement *) filter_option_new ();
+ return (EFilterElement *) e_filter_option_new ();
if (strcmp (type, "score") == 0)
- return (FilterElement *) filter_int_new_type ("score", -3, 3);
+ return (EFilterElement *) e_filter_int_new_type ("score", -3, 3);
/* Chain up to parent's new_element() method. */
- return RULE_CONTEXT_CLASS (parent_class)->new_element (context, type);
+ return E_RULE_CONTEXT_CLASS (parent_class)->new_element (context, type);
}
static void
search_context_class_init (EMSearchContextClass *class)
{
- RuleContextClass *rule_context_class;
+ ERuleContextClass *rule_context_class;
parent_class = g_type_class_peek_parent (class);
- rule_context_class = RULE_CONTEXT_CLASS (class);
+ rule_context_class = E_RULE_CONTEXT_CLASS (class);
rule_context_class->new_element = search_context_new_element;
}
static void
search_context_init (EMSearchContext *vc)
{
- RuleContext *rule_context;
+ ERuleContext *rule_context;
- rule_context = RULE_CONTEXT (vc);
- rule_context->flags = RULE_CONTEXT_THREADING | RULE_CONTEXT_GROUPING;
+ rule_context = E_RULE_CONTEXT (vc);
+ rule_context->flags = E_RULE_CONTEXT_THREADING | E_RULE_CONTEXT_GROUPING;
}
GType
@@ -89,13 +89,13 @@ em_search_context_get_type (void)
};
type = g_type_register_static (
- RULE_TYPE_CONTEXT, "EMSearchContext", &type_info, 0);
+ E_TYPE_RULE_CONTEXT, "EMSearchContext", &type_info, 0);
}
return type;
}
-RuleContext *
+ERuleContext *
em_search_context_new (void)
{
return g_object_new (EM_SEARCH_TYPE_CONTEXT, NULL);
diff --git a/mail/em-search-context.h b/mail/em-search-context.h
index d8b890270c..316a53a909 100644
--- a/mail/em-search-context.h
+++ b/mail/em-search-context.h
@@ -25,7 +25,7 @@
#ifndef EM_SEARCH_CONTEXT_H
#define EM_SEARCH_CONTEXT_H
-#include <filter/rule-context.h>
+#include <filter/e-rule-context.h>
/* Standard GObject macros */
#define EM_SEARCH_TYPE_CONTEXT \
@@ -52,15 +52,15 @@ typedef struct _EMSearchContext EMSearchContext;
typedef struct _EMSearchContextClass EMSearchContextClass;
struct _EMSearchContext {
- RuleContext parent;
+ ERuleContext parent;
};
struct _EMSearchContextClass {
- RuleContextClass parent_class;
+ ERuleContextClass parent_class;
};
GType em_search_context_get_type (void);
-RuleContext * em_search_context_new (void);
+ERuleContext * em_search_context_new (void);
G_END_DECLS
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 3c6c4ffee7..2154c62e57 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -243,7 +243,7 @@ em_filter_editor_response (GtkWidget *dialog, gint button, gpointer user_data)
data_dir = em_utils_get_data_dir ();
fc = g_object_get_data ((GObject *) dialog, "context");
user = g_strdup_printf ("%s/filters.xml", data_dir);
- rule_context_save ((RuleContext *) fc, user);
+ e_rule_context_save ((ERuleContext *) fc, user);
g_free (user);
}
@@ -283,12 +283,12 @@ em_utils_edit_filters (GtkWidget *parent)
fc = em_filter_context_new ();
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
- rule_context_load ((RuleContext *) fc, system, user);
+ e_rule_context_load ((ERuleContext *) fc, system, user);
g_free (user);
g_free (system);
- if (((RuleContext *) fc)->error) {
- GtkWidget *w = e_error_new((GtkWindow *)parent, "mail:filter-load-error", ((RuleContext *)fc)->error, NULL);
+ if (((ERuleContext *) fc)->error) {
+ GtkWidget *w = e_error_new((GtkWindow *)parent, "mail:filter-load-error", ((ERuleContext *)fc)->error, NULL);
em_utils_show_error_silent (w);
return;
}
diff --git a/mail/em-vfolder-context.c b/mail/em-vfolder-context.c
index b111376b20..789735683c 100644
--- a/mail/em-vfolder-context.c
+++ b/mail/em-vfolder-context.c
@@ -30,14 +30,14 @@
#include "em-vfolder-context.h"
#include "em-vfolder-rule.h"
-#include "filter/filter-option.h"
-#include "filter/filter-int.h"
+#include "filter/e-filter-option.h"
+#include "filter/e-filter-int.h"
#include "em-filter-folder-element.h"
-static FilterElement *vfolder_new_element(RuleContext *rc, const gchar *type);
+static EFilterElement *vfolder_new_element(ERuleContext *rc, const gchar *type);
-static RuleContextClass *parent_class = NULL;
+static ERuleContextClass *parent_class = NULL;
static void
em_vfolder_context_finalise(GObject *obj)
@@ -48,22 +48,22 @@ em_vfolder_context_finalise(GObject *obj)
static void
em_vfolder_context_class_init(EMVFolderContextClass *klass)
{
- parent_class = g_type_class_ref(RULE_TYPE_CONTEXT);
+ parent_class = g_type_class_ref(E_TYPE_RULE_CONTEXT);
((GObjectClass *)klass)->finalize = em_vfolder_context_finalise;
- ((RuleContextClass *)klass)->new_element = vfolder_new_element;
+ ((ERuleContextClass *)klass)->new_element = vfolder_new_element;
}
static void
em_vfolder_context_init(EMVFolderContext *vc)
{
- rule_context_add_part_set((RuleContext *) vc, "partset", filter_part_get_type(),
- rule_context_add_part, rule_context_next_part);
+ e_rule_context_add_part_set((ERuleContext *) vc, "partset", E_TYPE_FILTER_PART,
+ e_rule_context_add_part, e_rule_context_next_part);
- rule_context_add_rule_set((RuleContext *) vc, "ruleset", em_vfolder_rule_get_type(),
- rule_context_add_rule, rule_context_next_rule);
+ e_rule_context_add_rule_set((ERuleContext *) vc, "ruleset", em_vfolder_rule_get_type(),
+ e_rule_context_add_rule, e_rule_context_next_rule);
- ((RuleContext *)vc)->flags = RULE_CONTEXT_THREADING | RULE_CONTEXT_GROUPING;
+ ((ERuleContext *)vc)->flags = E_RULE_CONTEXT_THREADING | E_RULE_CONTEXT_GROUPING;
}
GType
@@ -84,7 +84,7 @@ em_vfolder_context_get_type(void)
(GInstanceInitFunc) em_vfolder_context_init,
};
- type = g_type_register_static(RULE_TYPE_CONTEXT, "EMVFolderContext", &info, 0);
+ type = g_type_register_static(E_TYPE_RULE_CONTEXT, "EMVFolderContext", &info, 0);
}
return type;
@@ -103,20 +103,20 @@ em_vfolder_context_new(void)
return (EMVFolderContext *)g_object_new(em_vfolder_context_get_type(), NULL, NULL);
}
-static FilterElement *
-vfolder_new_element(RuleContext *rc, const gchar *type)
+static EFilterElement *
+vfolder_new_element(ERuleContext *rc, const gchar *type)
{
if (!strcmp(type, "system-flag")) {
- return (FilterElement *) filter_option_new();
+ return (EFilterElement *) e_filter_option_new();
} else if (!strcmp(type, "score")) {
- return (FilterElement *) filter_int_new_type("score", -3, 3);
+ return (EFilterElement *) e_filter_int_new_type("score", -3, 3);
} else if (!strcmp(type, "folder-curi")) {
EMFilterFolderElement *ff = em_filter_folder_element_new ();
if (ff)
ff->store_camel_uri = TRUE;
- return (FilterElement *) ff;
+ return (EFilterElement *) ff;
} else if (!strcmp(type, "folder")) {
- return (FilterElement *) em_filter_folder_element_new();
+ return (EFilterElement *) em_filter_folder_element_new();
} else {
return parent_class->new_element(rc, type);
}
diff --git a/mail/em-vfolder-context.h b/mail/em-vfolder-context.h
index 7f17f4e2b4..baf3f5ff32 100644
--- a/mail/em-vfolder-context.h
+++ b/mail/em-vfolder-context.h
@@ -25,7 +25,7 @@
#ifndef _EM_VFOLDER_CONTEXT_H
#define _EM_VFOLDER_CONTEXT_H
-#include "filter/rule-context.h"
+#include "filter/e-rule-context.h"
#define EM_VFOLDER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_vfolder_context_get_type(), EMVFolderContext))
#define EM_VFOLDER_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_vfolder_context_get_type(), EMVFolderContextClass))
@@ -37,12 +37,12 @@ typedef struct _EMVFolderContext EMVFolderContext;
typedef struct _EMVFolderContextClass EMVFolderContextClass;
struct _EMVFolderContext {
- RuleContext parent_object;
+ ERuleContext parent_object;
};
struct _EMVFolderContextClass {
- RuleContextClass parent_class;
+ ERuleContextClass parent_class;
};
GType em_vfolder_context_get_type (void);
diff --git a/mail/em-vfolder-editor.c b/mail/em-vfolder-editor.c
index 058ad0a957..073a4c5c90 100644
--- a/mail/em-vfolder-editor.c
+++ b/mail/em-vfolder-editor.c
@@ -38,16 +38,16 @@
static gpointer parent_class;
-static FilterRule *
-vfolder_editor_create_rule (RuleEditor *rule_editor)
+static EFilterRule *
+vfolder_editor_create_rule (ERuleEditor *rule_editor)
{
- FilterRule *rule = filter_rule_new ();
- FilterPart *part;
+ EFilterRule *rule = e_filter_rule_new ();
+ EFilterPart *part;
/* create a rule with 1 part in it */
- rule = (FilterRule *) em_vfolder_rule_new ();
- part = rule_context_next_part (rule_editor->context, NULL);
- filter_rule_add_part (rule, filter_part_clone (part));
+ rule = (EFilterRule *) em_vfolder_rule_new ();
+ part = e_rule_context_next_part (rule_editor->context, NULL);
+ e_filter_rule_add_part (rule, e_filter_part_clone (part));
return rule;
}
@@ -55,11 +55,11 @@ vfolder_editor_create_rule (RuleEditor *rule_editor)
static void
vfolder_editor_class_init (EMVFolderEditorClass *class)
{
- RuleEditorClass *rule_editor_class;
+ ERuleEditorClass *rule_editor_class;
parent_class = g_type_class_peek_parent (class);
- rule_editor_class = RULE_EDITOR_CLASS (class);
+ rule_editor_class = E_RULE_EDITOR_CLASS (class);
rule_editor_class->create_rule = vfolder_editor_create_rule;
}
@@ -96,7 +96,7 @@ em_vfolder_editor_get_type (void)
};
type = g_type_register_static (
- RULE_TYPE_EDITOR, "EMVFolderEditor", &type_info, 0);
+ E_TYPE_RULE_EDITOR, "EMVFolderEditor", &type_info, 0);
}
return type;
@@ -123,7 +123,7 @@ em_vfolder_editor_new (EMVFolderContext *vc)
gui = glade_xml_new (gladefile, "rule_editor", NULL);
g_free (gladefile);
- rule_editor_construct ((RuleEditor *) ve, (RuleContext *) vc, gui, "incoming", _("Search _Folders"));
+ e_rule_editor_construct ((ERuleEditor *) ve, (ERuleContext *) vc, gui, "incoming", _("Search _Folders"));
gtk_widget_hide (glade_xml_get_widget (gui, "label17"));
gtk_widget_hide (glade_xml_get_widget (gui, "filter_source_combobox"));
g_object_unref (gui);
diff --git a/mail/em-vfolder-editor.h b/mail/em-vfolder-editor.h
index 2a48c46e87..2548582ad7 100644
--- a/mail/em-vfolder-editor.h
+++ b/mail/em-vfolder-editor.h
@@ -24,7 +24,7 @@
#ifndef EM_VFOLDER_EDITOR_H
#define EM_VFOLDER_EDITOR_H
-#include "filter/rule-editor.h"
+#include "filter/e-rule-editor.h"
#include "em-vfolder-context.h"
/* Standard GObject macros */
@@ -52,11 +52,11 @@ typedef struct _EMVFolderEditor EMVFolderEditor;
typedef struct _EMVFolderEditorClass EMVFolderEditorClass;
struct _EMVFolderEditor {
- RuleEditor parent;
+ ERuleEditor parent;
};
struct _EMVFolderEditorClass {
- RuleEditorClass parent_class;
+ ERuleEditorClass parent_class;
};
GType em_vfolder_editor_get_type (void);
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c
index 3a87c09751..50016d095d 100644
--- a/mail/em-vfolder-rule.c
+++ b/mail/em-vfolder-rule.c
@@ -43,13 +43,13 @@
#define d(x)
-static gint validate(FilterRule *, GtkWindow *error_parent);
-static gint vfolder_eq(FilterRule *fr, FilterRule *cm);
-static xmlNodePtr xml_encode(FilterRule *);
-static gint xml_decode(FilterRule *, xmlNodePtr, RuleContext *f);
-static void rule_copy(FilterRule *dest, FilterRule *src);
-/*static void build_code(FilterRule *, GString *out);*/
-static GtkWidget *get_widget(FilterRule *fr, RuleContext *f);
+static gint validate(EFilterRule *, GtkWindow *error_parent);
+static gint vfolder_eq(EFilterRule *fr, EFilterRule *cm);
+static xmlNodePtr xml_encode(EFilterRule *);
+static gint xml_decode(EFilterRule *, xmlNodePtr, ERuleContext *f);
+static void rule_copy(EFilterRule *dest, EFilterRule *src);
+/*static void build_code(EFilterRule *, GString *out);*/
+static GtkWidget *get_widget(EFilterRule *fr, ERuleContext *f);
static void em_vfolder_rule_class_init(EMVFolderRuleClass *klass);
static void em_vfolder_rule_init(EMVFolderRule *vr);
@@ -63,7 +63,7 @@ static const gchar *with_names[] = {
"local"
};
-static FilterRuleClass *parent_class = NULL;
+static EFilterRuleClass *parent_class = NULL;
GType
em_vfolder_rule_get_type(void)
@@ -83,7 +83,7 @@ em_vfolder_rule_get_type(void)
(GInstanceInitFunc)em_vfolder_rule_init,
};
- type = g_type_register_static(FILTER_TYPE_RULE, "EMVFolderRule", &info, 0);
+ type = g_type_register_static(E_TYPE_FILTER_RULE, "EMVFolderRule", &info, 0);
}
return type;
@@ -93,9 +93,9 @@ static void
em_vfolder_rule_class_init(EMVFolderRuleClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS(klass);
- FilterRuleClass *fr_class =(FilterRuleClass *)klass;
+ EFilterRuleClass *fr_class =(EFilterRuleClass *)klass;
- parent_class = g_type_class_ref(FILTER_TYPE_RULE);
+ parent_class = g_type_class_ref(E_TYPE_FILTER_RULE);
object_class->finalize = em_vfolder_rule_finalise;
@@ -148,7 +148,7 @@ em_vfolder_rule_add_source(EMVFolderRule *vr, const gchar *uri)
vr->sources = g_list_append(vr->sources, g_strdup(uri));
- filter_rule_emit_changed((FilterRule *)vr);
+ e_filter_rule_emit_changed((EFilterRule *)vr);
}
const gchar *
@@ -181,7 +181,7 @@ em_vfolder_rule_remove_source(EMVFolderRule *vr, const gchar *uri)
if (found) {
vr->sources = g_list_remove(vr->sources, found);
g_free(found);
- filter_rule_emit_changed((FilterRule *)vr);
+ e_filter_rule_emit_changed((EFilterRule *)vr);
}
}
@@ -207,7 +207,7 @@ em_vfolder_rule_next_source(EMVFolderRule *vr, const gchar *last)
}
static gint
-validate(FilterRule *fr, GtkWindow *error_parent)
+validate(EFilterRule *fr, GtkWindow *error_parent)
{
g_return_val_if_fail(fr != NULL, 0);
@@ -223,7 +223,7 @@ validate(FilterRule *fr, GtkWindow *error_parent)
return 0;
}
- return FILTER_RULE_CLASS(parent_class)->validate (fr, error_parent);
+ return E_FILTER_RULE_CLASS(parent_class)->validate (fr, error_parent);
}
static gint
@@ -243,20 +243,20 @@ list_eq(GList *al, GList *bl)
}
static gint
-vfolder_eq(FilterRule *fr, FilterRule *cm)
+vfolder_eq(EFilterRule *fr, EFilterRule *cm)
{
- return FILTER_RULE_CLASS(parent_class)->eq(fr, cm)
+ return E_FILTER_RULE_CLASS(parent_class)->eq(fr, cm)
&& list_eq(((EMVFolderRule *)fr)->sources, ((EMVFolderRule *)cm)->sources);
}
static xmlNodePtr
-xml_encode(FilterRule *fr)
+xml_encode(EFilterRule *fr)
{
EMVFolderRule *vr =(EMVFolderRule *)fr;
xmlNodePtr node, set, work;
GList *l;
- node = FILTER_RULE_CLASS(parent_class)->xml_encode(fr);
+ node = E_FILTER_RULE_CLASS(parent_class)->xml_encode(fr);
g_return_val_if_fail (node != NULL, NULL);
g_return_val_if_fail (vr->with < G_N_ELEMENTS (with_names), NULL);
@@ -290,14 +290,14 @@ set_with(EMVFolderRule *vr, const gchar *name)
}
static gint
-xml_decode(FilterRule *fr, xmlNodePtr node, struct _RuleContext *f)
+xml_decode(EFilterRule *fr, xmlNodePtr node, struct _ERuleContext *f)
{
xmlNodePtr set, work;
gint result;
EMVFolderRule *vr =(EMVFolderRule *)fr;
gchar *tmp;
- result = FILTER_RULE_CLASS(parent_class)->xml_decode(fr, node, f);
+ result = E_FILTER_RULE_CLASS(parent_class)->xml_decode(fr, node, f);
if (result != 0)
return result;
@@ -334,7 +334,7 @@ xml_decode(FilterRule *fr, xmlNodePtr node, struct _RuleContext *f)
}
static void
-rule_copy(FilterRule *dest, FilterRule *src)
+rule_copy(EFilterRule *dest, EFilterRule *src)
{
EMVFolderRule *vdest, *vsrc;
GList *node;
@@ -358,7 +358,7 @@ rule_copy(FilterRule *dest, FilterRule *src)
vdest->with = vsrc->with;
- FILTER_RULE_CLASS(parent_class)->copy(dest, src);
+ E_FILTER_RULE_CLASS(parent_class)->copy(dest, src);
}
enum {
@@ -368,7 +368,7 @@ enum {
};
struct _source_data {
- RuleContext *rc;
+ ERuleContext *rc;
EMVFolderRule *vr;
const gchar *current;
GtkListStore *model;
@@ -611,7 +611,7 @@ em_vfolder_editor_sourcelist_new(gchar *widget_name, gchar *string1, gchar *stri
}
static GtkWidget *
-get_widget(FilterRule *fr, RuleContext *rc)
+get_widget(EFilterRule *fr, ERuleContext *rc)
{
EMVFolderRule *vr =(EMVFolderRule *)fr;
GtkWidget *widget, *frame, *list;
@@ -623,7 +623,7 @@ get_widget(FilterRule *fr, RuleContext *rc)
gint i;
gchar *gladefile;
- widget = FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc);
+ widget = E_FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc);
data = g_malloc0(sizeof(*data));
data->rc = rc;
diff --git a/mail/em-vfolder-rule.h b/mail/em-vfolder-rule.h
index 1c0b2a3113..a5c80356e7 100644
--- a/mail/em-vfolder-rule.h
+++ b/mail/em-vfolder-rule.h
@@ -24,7 +24,7 @@
#ifndef _EM_VFOLDER_RULE_H
#define _EM_VFOLDER_RULE_H
-#include "filter/filter-rule.h"
+#include "filter/e-filter-rule.h"
#define EM_VFOLDER_RULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), em_vfolder_rule_get_type(), EMVFolderRule))
#define EM_VFOLDER_RULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), em_vfolder_rule_get_type(), EMVFolderRuleClass))
@@ -46,14 +46,14 @@ typedef struct _EMVFolderRuleClass EMVFolderRuleClass;
typedef enum _em_vfolder_rule_with_t em_vfolder_rule_with_t;
struct _EMVFolderRule {
- FilterRule rule;
+ EFilterRule rule;
em_vfolder_rule_with_t with;
GList *sources; /* uri's of the source folders */
};
struct _EMVFolderRuleClass {
- FilterRuleClass parent_class;
+ EFilterRuleClass parent_class;
};
GType em_vfolder_rule_get_type (void);
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index cf6575d0c5..d64a4ae282 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -43,7 +43,7 @@
#include "em-filter-context.h"
#include "em-filter-rule.h"
#include "em-filter-editor.h"
-#include "filter/filter-option.h"
+#include "filter/e-filter-option.h"
#include <camel/camel-internet-address.h>
#include <camel/camel-mime-message.h>
@@ -51,25 +51,25 @@
#define d(x)
static void
-rule_match_recipients (RuleContext *context, FilterRule *rule, CamelInternetAddress *iaddr)
+rule_match_recipients (ERuleContext *context, EFilterRule *rule, CamelInternetAddress *iaddr)
{
- FilterPart *part;
- FilterElement *element;
+ EFilterPart *part;
+ EFilterElement *element;
gint i;
const gchar *real, *addr;
gchar *namestr;
/* address types etc should handle multiple values */
for (i = 0; camel_internet_address_get (iaddr, i, &real, &addr); i++) {
- part = rule_context_create_part (context, "to");
- filter_rule_add_part ((FilterRule *)rule, part);
- element = filter_part_find_element (part, "recipient-type");
- filter_option_set_current ((FilterOption *)element, "contains");
- element = filter_part_find_element (part, "recipient");
- filter_input_set_value ((FilterInput *)element, addr);
+ part = e_rule_context_create_part (context, "to");
+ e_filter_rule_add_part ((EFilterRule *)rule, part);
+ element = e_filter_part_find_element (part, "recipient-type");
+ e_filter_option_set_current ((EFilterOption *)element, "contains");
+ element = e_filter_part_find_element (part, "recipient");
+ e_filter_input_set_value ((EFilterInput *)element, addr);
namestr = g_strdup_printf (_("Mail to %s"), real && real[0] ? real : addr);
- filter_rule_set_name (rule, namestr);
+ e_filter_rule_set_name (rule, namestr);
g_free (namestr);
}
}
@@ -122,43 +122,43 @@ reg_match (gchar *str, gchar *regstr)
#endif
static void
-rule_add_subject (RuleContext *context, FilterRule *rule, const gchar *text)
+rule_add_subject (ERuleContext *context, EFilterRule *rule, const gchar *text)
{
- FilterPart *part;
- FilterElement *element;
+ EFilterPart *part;
+ EFilterElement *element;
/* dont match on empty strings ever */
if (*text == 0)
return;
- part = rule_context_create_part (context, "subject");
- filter_rule_add_part ((FilterRule *)rule, part);
- element = filter_part_find_element (part, "subject-type");
- filter_option_set_current ((FilterOption *)element, "contains");
- element = filter_part_find_element (part, "subject");
- filter_input_set_value ((FilterInput *)element, text);
+ part = e_rule_context_create_part (context, "subject");
+ e_filter_rule_add_part ((EFilterRule *)rule, part);
+ element = e_filter_part_find_element (part, "subject-type");
+ e_filter_option_set_current ((EFilterOption *)element, "contains");
+ element = e_filter_part_find_element (part, "subject");
+ e_filter_input_set_value ((EFilterInput *)element, text);
}
static void
-rule_add_sender (RuleContext *context, FilterRule *rule, const gchar *text)
+rule_add_sender (ERuleContext *context, EFilterRule *rule, const gchar *text)
{
- FilterPart *part;
- FilterElement *element;
+ EFilterPart *part;
+ EFilterElement *element;
/* dont match on empty strings ever */
if (*text == 0)
return;
- part = rule_context_create_part (context, "sender");
- filter_rule_add_part ((FilterRule *)rule, part);
- element = filter_part_find_element (part, "sender-type");
- filter_option_set_current ((FilterOption *)element, "contains");
- element = filter_part_find_element (part, "sender");
- filter_input_set_value ((FilterInput *)element, text);
+ part = e_rule_context_create_part (context, "sender");
+ e_filter_rule_add_part ((EFilterRule *)rule, part);
+ element = e_filter_part_find_element (part, "sender-type");
+ e_filter_option_set_current ((EFilterOption *)element, "contains");
+ element = e_filter_part_find_element (part, "sender");
+ e_filter_input_set_value ((EFilterInput *)element, text);
}
/* do a bunch of things on the subject to try and detect mailing lists, remove
unneeded stuff, etc */
static void
-rule_match_subject (RuleContext *context, FilterRule *rule, const gchar *subject)
+rule_match_subject (ERuleContext *context, EFilterRule *rule, const gchar *subject)
{
const gchar *s;
const gchar *s1, *s2;
@@ -200,28 +200,28 @@ rule_match_subject (RuleContext *context, FilterRule *rule, const gchar *subject
}
static void
-rule_match_mlist(RuleContext *context, FilterRule *rule, const gchar *mlist)
+rule_match_mlist(ERuleContext *context, EFilterRule *rule, const gchar *mlist)
{
- FilterPart *part;
- FilterElement *element;
+ EFilterPart *part;
+ EFilterElement *element;
if (mlist[0] == 0)
return;
- part = rule_context_create_part(context, "mlist");
- filter_rule_add_part(rule, part);
+ part = e_rule_context_create_part(context, "mlist");
+ e_filter_rule_add_part(rule, part);
- element = filter_part_find_element(part, "mlist-type");
- filter_option_set_current((FilterOption *)element, "is");
+ element = e_filter_part_find_element(part, "mlist-type");
+ e_filter_option_set_current((EFilterOption *)element, "is");
- element = filter_part_find_element (part, "mlist");
- filter_input_set_value((FilterInput *)element, mlist);
+ element = e_filter_part_find_element (part, "mlist");
+ e_filter_input_set_value((EFilterInput *)element, mlist);
}
static void
-rule_from_address (FilterRule *rule, RuleContext *context, CamelInternetAddress* addr, gint flags)
+rule_from_address (EFilterRule *rule, ERuleContext *context, CamelInternetAddress* addr, gint flags)
{
- rule->grouping = FILTER_GROUP_ANY;
+ rule->grouping = E_FILTER_GROUP_ANY;
if (flags & AUTO_FROM) {
const gchar *name, *address;
@@ -232,7 +232,7 @@ rule_from_address (FilterRule *rule, RuleContext *context, CamelInternetAddress*
if (name == NULL || name[0] == '\0')
name = address;
namestr = g_strdup_printf(_("Mail from %s"), name);
- filter_rule_set_name (rule, namestr);
+ e_filter_rule_set_name (rule, namestr);
g_free (namestr);
}
if (flags & AUTO_TO) {
@@ -242,11 +242,11 @@ rule_from_address (FilterRule *rule, RuleContext *context, CamelInternetAddress*
}
static void
-rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg, gint flags)
+rule_from_message (EFilterRule *rule, ERuleContext *context, CamelMimeMessage *msg, gint flags)
{
CamelInternetAddress *addr;
- rule->grouping = FILTER_GROUP_ANY;
+ rule->grouping = E_FILTER_GROUP_ANY;
if (flags & AUTO_SUBJECT) {
const gchar *subject = msg->subject ? msg->subject : "";
@@ -255,7 +255,7 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg
rule_match_subject (context, rule, subject);
namestr = g_strdup_printf (_("Subject is %s"), strip_re (subject));
- filter_rule_set_name (rule, namestr);
+ e_filter_rule_set_name (rule, namestr);
g_free (namestr);
}
/* should parse the from address into an internet address? */
@@ -271,7 +271,7 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg
if (name == NULL || name[0] == '\0')
name = address;
namestr = g_strdup_printf(_("Mail from %s"), name);
- filter_rule_set_name (rule, namestr);
+ e_filter_rule_set_name (rule, namestr);
g_free (namestr);
}
}
@@ -290,14 +290,14 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg
if (mlist) {
rule_match_mlist(context, rule, mlist);
name = g_strdup_printf (_("%s mailing list"), mlist);
- filter_rule_set_name(rule, name);
+ e_filter_rule_set_name(rule, name);
g_free(name);
}
g_free(mlist);
}
}
-FilterRule *
+EFilterRule *
em_vfolder_rule_from_message (EMVFolderContext *context, CamelMimeMessage *msg, gint flags, const gchar *source)
{
EMVFolderRule *rule;
@@ -305,13 +305,13 @@ em_vfolder_rule_from_message (EMVFolderContext *context, CamelMimeMessage *msg,
rule = em_vfolder_rule_new ();
em_vfolder_rule_add_source (rule, euri);
- rule_from_message ((FilterRule *)rule, (RuleContext *)context, msg, flags);
+ rule_from_message ((EFilterRule *)rule, (ERuleContext *)context, msg, flags);
g_free(euri);
- return (FilterRule *)rule;
+ return (EFilterRule *)rule;
}
-FilterRule *
+EFilterRule *
em_vfolder_rule_from_address (EMVFolderContext *context, CamelInternetAddress *addr, gint flags, const gchar *source)
{
EMVFolderRule *rule;
@@ -319,25 +319,25 @@ em_vfolder_rule_from_address (EMVFolderContext *context, CamelInternetAddress *a
rule = em_vfolder_rule_new ();
em_vfolder_rule_add_source (rule, euri);
- rule_from_address ((FilterRule *)rule, (RuleContext *)context, addr, flags);
+ rule_from_address ((EFilterRule *)rule, (ERuleContext *)context, addr, flags);
g_free(euri);
- return (FilterRule *)rule;
+ return (EFilterRule *)rule;
}
-FilterRule *
+EFilterRule *
filter_rule_from_message (EMFilterContext *context, CamelMimeMessage *msg, gint flags)
{
EMFilterRule *rule;
- FilterPart *part;
+ EFilterPart *part;
rule = em_filter_rule_new ();
- rule_from_message ((FilterRule *)rule, (RuleContext *)context, msg, flags);
+ rule_from_message ((EFilterRule *)rule, (ERuleContext *)context, msg, flags);
part = em_filter_context_next_action (context, NULL);
- em_filter_rule_add_action (rule, filter_part_clone (part));
+ em_filter_rule_add_action (rule, e_filter_part_clone (part));
- return (FilterRule *)rule;
+ return (EFilterRule *)rule;
}
void
@@ -346,7 +346,7 @@ filter_gui_add_from_message (CamelMimeMessage *msg, const gchar *source, gint fl
EMFilterContext *fc;
const gchar *data_dir;
gchar *user, *system;
- FilterRule *rule;
+ EFilterRule *rule;
g_return_if_fail (msg != NULL);
@@ -354,14 +354,14 @@ filter_gui_add_from_message (CamelMimeMessage *msg, const gchar *source, gint fl
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
- rule_context_load ((RuleContext *)fc, system, user);
+ e_rule_context_load ((ERuleContext *)fc, system, user);
g_free (system);
rule = filter_rule_from_message (fc, msg, flags);
- filter_rule_set_source (rule, source);
+ e_filter_rule_set_source (rule, source);
- rule_context_add_rule_gui ((RuleContext *)fc, rule, _("Add Filter Rule"), user);
+ e_rule_context_add_rule_gui ((ERuleContext *)fc, rule, _("Add Filter Rule"), user);
g_free (user);
g_object_unref (fc);
}
@@ -382,15 +382,15 @@ mail_filter_rename_uri(CamelStore *store, const gchar *olduri, const gchar *newu
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
- rule_context_load ((RuleContext *)fc, system, user);
+ e_rule_context_load ((ERuleContext *)fc, system, user);
g_free (system);
- changed = rule_context_rename_uri((RuleContext *)fc, eolduri, enewuri, g_str_equal);
+ changed = e_rule_context_rename_uri((ERuleContext *)fc, eolduri, enewuri, g_str_equal);
if (changed) {
d(printf("Folder rename '%s' -> '%s' changed filters, resaving\n", olduri, newuri));
- if (rule_context_save((RuleContext *)fc, user) == -1)
+ if (e_rule_context_save((ERuleContext *)fc, user) == -1)
g_warning("Could not write out changed filter rules\n");
- rule_context_free_uri_list((RuleContext *)fc, changed);
+ e_rule_context_free_uri_list((ERuleContext *)fc, changed);
}
g_free(user);
@@ -415,10 +415,10 @@ mail_filter_delete_uri(CamelStore *store, const gchar *uri)
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
- rule_context_load ((RuleContext *)fc, system, user);
+ e_rule_context_load ((ERuleContext *)fc, system, user);
g_free (system);
- deleted = rule_context_delete_uri ((RuleContext *) fc, euri, g_str_equal);
+ deleted = e_rule_context_delete_uri ((ERuleContext *) fc, euri, g_str_equal);
if (deleted) {
GtkWidget *dialog;
GString *s;
@@ -436,9 +436,9 @@ mail_filter_delete_uri(CamelStore *store, const gchar *uri)
em_utils_show_info_silent (dialog);
d(printf("Folder delete/rename '%s' changed filters, resaving\n", euri));
- if (rule_context_save ((RuleContext *) fc, user) == -1)
+ if (e_rule_context_save ((ERuleContext *) fc, user) == -1)
g_warning ("Could not write out changed filter rules\n");
- rule_context_free_uri_list ((RuleContext *) fc, deleted);
+ e_rule_context_free_uri_list ((ERuleContext *) fc, deleted);
}
g_free(user);
diff --git a/mail/mail-autofilter.h b/mail/mail-autofilter.h
index 8ad98589ef..fb474ab04d 100644
--- a/mail/mail-autofilter.h
+++ b/mail/mail-autofilter.h
@@ -26,7 +26,7 @@
#include <camel/camel-mime-message.h>
-#include <filter/filter-rule.h>
+#include <filter/e-filter-rule.h>
#include <mail/em-filter-context.h>
#include <mail/em-vfolder-context.h>
@@ -37,9 +37,9 @@ enum {
AUTO_MLIST = 8
};
-FilterRule *em_vfolder_rule_from_message(EMVFolderContext *context, CamelMimeMessage *msg, gint flags, const gchar *source);
-FilterRule *filter_rule_from_message(EMFilterContext *context, CamelMimeMessage *msg, gint flags);
-FilterRule *em_vfolder_rule_from_address(EMVFolderContext *context, CamelInternetAddress *addr, gint flags, const gchar *source);
+EFilterRule *em_vfolder_rule_from_message(EMVFolderContext *context, CamelMimeMessage *msg, gint flags, const gchar *source);
+EFilterRule *filter_rule_from_message(EMFilterContext *context, CamelMimeMessage *msg, gint flags);
+EFilterRule *em_vfolder_rule_from_address(EMVFolderContext *context, CamelInternetAddress *addr, gint flags, const gchar *source);
/* easiest place to put this */
void filter_gui_add_from_message(CamelMimeMessage *msg, const gchar *source, gint flags);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index a251c871a9..27b5ef80ce 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -231,13 +231,13 @@ mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids,
void
mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids)
{
- mail_filter_folder (folder, uids, FILTER_SOURCE_DEMAND, FALSE, NULL);
+ mail_filter_folder (folder, uids, E_FILTER_SOURCE_DEMAND, FALSE, NULL);
}
void
mail_filter_junk (CamelFolder *folder, GPtrArray *uids)
{
- mail_filter_folder (folder, uids, FILTER_SOURCE_JUNKTEST, FALSE, NULL);
+ mail_filter_folder (folder, uids, E_FILTER_SOURCE_JUNKTEST, FALSE, NULL);
}
/* ********************************************************************** */
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index b0cff31a9d..6244685842 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -741,7 +741,7 @@ receive_done (const gchar *uri, gpointer data)
info->again = 0;
mail_send_queue (local_outbox,
info->uri,
- FILTER_SOURCE_OUTGOING,
+ E_FILTER_SOURCE_OUTGOING,
info->cancel,
receive_get_folder, info,
receive_status, info,
@@ -1002,7 +1002,7 @@ mail_send_receive (GtkWindow *parent)
switch (info->type) {
case SEND_RECEIVE:
mail_fetch_mail(info->uri, info->keep_on_server,
- FILTER_SOURCE_INCOMING,
+ E_FILTER_SOURCE_INCOMING,
info->cancel,
receive_get_folder, info,
receive_status, info,
@@ -1011,7 +1011,7 @@ mail_send_receive (GtkWindow *parent)
case SEND_SEND:
/* todo, store the folder in info? */
mail_send_queue(local_outbox, info->uri,
- FILTER_SOURCE_OUTGOING,
+ E_FILTER_SOURCE_OUTGOING,
info->cancel,
receive_get_folder, info,
receive_status, info,
@@ -1217,7 +1217,7 @@ mail_receive_uri (const gchar *uri, gboolean keep_on_server)
switch (info->type) {
case SEND_RECEIVE:
mail_fetch_mail (info->uri, info->keep_on_server,
- FILTER_SOURCE_INCOMING,
+ E_FILTER_SOURCE_INCOMING,
info->cancel,
receive_get_folder, info,
receive_status, info,
@@ -1227,7 +1227,7 @@ mail_receive_uri (const gchar *uri, gboolean keep_on_server)
/* todo, store the folder in info? */
local_outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
mail_send_queue (local_outbox, info->uri,
- FILTER_SOURCE_OUTGOING,
+ E_FILTER_SOURCE_OUTGOING,
info->cancel,
receive_get_folder, info,
receive_status, info,
@@ -1289,7 +1289,7 @@ mail_send (void)
/* todo, store the folder in info? */
local_outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
mail_send_queue (local_outbox, info->uri,
- FILTER_SOURCE_OUTGOING,
+ E_FILTER_SOURCE_OUTGOING,
info->cancel,
receive_get_folder, info,
receive_status, info,
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 2b6f902a20..967909d6e3 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -506,19 +506,19 @@ static CamelFilterDriver *
main_get_filter_driver (CamelSession *session, const gchar *type, CamelException *ex)
{
CamelFilterDriver *driver;
- FilterRule *rule = NULL;
+ EFilterRule *rule = NULL;
const gchar *data_dir;
gchar *user, *system;
GConfClient *gconf;
- RuleContext *fc;
+ ERuleContext *fc;
gconf = mail_config_get_gconf_client ();
data_dir = e_shell_backend_get_data_dir (session_shell_backend);
user = g_build_filename (data_dir, "filters.xml", NULL);
system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL);
- fc = (RuleContext *) em_filter_context_new ();
- rule_context_load (fc, system, user);
+ fc = (ERuleContext *) em_filter_context_new ();
+ e_rule_context_load (fc, system, user);
g_free (system);
g_free (user);
@@ -546,23 +546,23 @@ main_get_filter_driver (CamelSession *session, const gchar *type, CamelException
camel_filter_driver_set_play_sound_func (driver, session_play_sound, NULL);
camel_filter_driver_set_system_beep_func (driver, session_system_beep, NULL);
- if ((!strcmp (type, FILTER_SOURCE_INCOMING) || !strcmp (type, FILTER_SOURCE_JUNKTEST))
+ if ((!strcmp (type, E_FILTER_SOURCE_INCOMING) || !strcmp (type, E_FILTER_SOURCE_JUNKTEST))
&& camel_session_check_junk (session)) {
/* implicit junk check as 1st rule */
camel_filter_driver_add_rule (driver, "Junk check", "(junk-test)", "(begin (set-system-flag \"junk\"))");
}
- if (strcmp (type, FILTER_SOURCE_JUNKTEST) != 0) {
+ if (strcmp (type, E_FILTER_SOURCE_JUNKTEST) != 0) {
GString *fsearch, *faction;
fsearch = g_string_new ("");
faction = g_string_new ("");
- if (!strcmp (type, FILTER_SOURCE_DEMAND))
- type = FILTER_SOURCE_INCOMING;
+ if (!strcmp (type, E_FILTER_SOURCE_DEMAND))
+ type = E_FILTER_SOURCE_INCOMING;
/* add the user-defined rules next */
- while ((rule = rule_context_next_rule (fc, rule, type))) {
+ while ((rule = e_rule_context_next_rule (fc, rule, type))) {
g_string_truncate (fsearch, 0);
g_string_truncate (faction, 0);
@@ -570,7 +570,7 @@ main_get_filter_driver (CamelSession *session, const gchar *type, CamelException
if (!rule->enabled)
continue;
- filter_rule_build_code (rule, fsearch);
+ e_filter_rule_build_code (rule, fsearch);
em_filter_rule_build_action ((EMFilterRule *) rule, faction);
camel_filter_driver_add_rule (driver, rule->name, fsearch->str, faction->str);
}
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 4c21a6db4c..1403605b33 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -44,8 +44,8 @@
#include <camel/camel-movemail.h>
#include <camel/camel-vee-folder.h>
-#include "filter/filter-option.h"
-#include "filter/filter-input.h"
+#include "filter/e-filter-option.h"
+#include "filter/e-filter-input.h"
#include <libedataserver/e-data-server-util.h>
#include "em-utils.h"
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 1612b283c2..9fed82744f 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -69,7 +69,7 @@ static volatile gint shutdown; /* are we shutting down? */
/* more globals ... */
extern CamelSession *session;
-static void rule_changed(FilterRule *rule, CamelFolder *folder);
+static void rule_changed(EFilterRule *rule, CamelFolder *folder);
/* ********************************************************************** */
@@ -427,7 +427,7 @@ uri_is_spethal(CamelStore *store, const gchar *uri)
void
mail_vfolder_add_uri(CamelStore *store, const gchar *curi, gint remove)
{
- FilterRule *rule;
+ EFilterRule *rule;
const gchar *source;
CamelVeeFolder *vf;
GList *folders = NULL, *link;
@@ -479,7 +479,7 @@ mail_vfolder_add_uri(CamelStore *store, const gchar *curi, gint remove)
goto done;
rule = NULL;
- while ((rule = rule_context_next_rule((RuleContext *)context, rule, NULL))) {
+ while ((rule = e_rule_context_next_rule((ERuleContext *)context, rule, NULL))) {
gint found = FALSE;
if (!rule->name) {
@@ -527,7 +527,7 @@ done:
void
mail_vfolder_delete_uri(CamelStore *store, const gchar *curi)
{
- FilterRule *rule;
+ EFilterRule *rule;
const gchar *source;
CamelVeeFolder *vf;
GString *changed;
@@ -552,7 +552,7 @@ mail_vfolder_delete_uri(CamelStore *store, const gchar *curi)
/* see if any rules directly reference this removed uri */
rule = NULL;
- while ((rule = rule_context_next_rule ((RuleContext *) context, rule, NULL))) {
+ while ((rule = e_rule_context_next_rule ((ERuleContext *) context, rule, NULL))) {
if (!rule->name) {
d(printf("invalid rule (%p): rule->name is set to NULL\n", rule));
@@ -605,7 +605,7 @@ done:
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save ((RuleContext *) context, user);
+ e_rule_context_save ((ERuleContext *) context, user);
g_free (user);
}
@@ -618,7 +618,7 @@ done:
void
mail_vfolder_rename_uri(CamelStore *store, const gchar *cfrom, const gchar *cto)
{
- FilterRule *rule;
+ EFilterRule *rule;
const gchar *source;
CamelVeeFolder *vf;
gint changed = 0;
@@ -638,7 +638,7 @@ mail_vfolder_rename_uri(CamelStore *store, const gchar *cfrom, const gchar *cto)
/* see if any rules directly reference this removed uri */
rule = NULL;
- while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) {
+ while ( (rule = e_rule_context_next_rule((ERuleContext *)context, rule, NULL)) ) {
source = NULL;
while ( (source = em_vfolder_rule_next_source((EMVFolderRule *)rule, source)) ) {
gchar *csource = em_uri_to_camel(source);
@@ -673,7 +673,7 @@ mail_vfolder_rename_uri(CamelStore *store, const gchar *cfrom, const gchar *cto)
d(printf("Vfolders updated from renamed folder\n"));
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save((RuleContext *)context, user);
+ e_rule_context_save((ERuleContext *)context, user);
g_free(user);
}
@@ -695,7 +695,7 @@ mail_vfolder_get_sources_remote (void)
/* ********************************************************************** */
-static void context_rule_added(RuleContext *ctx, FilterRule *rule);
+static void context_rule_added(ERuleContext *ctx, EFilterRule *rule);
static void
rule_add_sources(GList *l, GList **sources_folderp, GList **sources_urip)
@@ -722,7 +722,7 @@ rule_add_sources(GList *l, GList **sources_folderp, GList **sources_urip)
}
static void
-rule_changed(FilterRule *rule, CamelFolder *folder)
+rule_changed(EFilterRule *rule, CamelFolder *folder)
{
GList *sources_uri = NULL, *sources_folder = NULL;
GString *query;
@@ -765,14 +765,14 @@ rule_changed(FilterRule *rule, CamelFolder *folder)
G_UNLOCK (vfolder);
query = g_string_new("");
- filter_rule_build_code(rule, query);
+ e_filter_rule_build_code(rule, query);
vfolder_setup(folder, query->str, sources_uri, sources_folder);
g_string_free(query, TRUE);
}
-static void context_rule_added(RuleContext *ctx, FilterRule *rule)
+static void context_rule_added(ERuleContext *ctx, EFilterRule *rule)
{
CamelFolder *folder;
@@ -791,7 +791,7 @@ static void context_rule_added(RuleContext *ctx, FilterRule *rule)
}
}
-static void context_rule_removed(RuleContext *ctx, FilterRule *rule)
+static void context_rule_removed(ERuleContext *ctx, EFilterRule *rule)
{
gpointer key, folder = NULL;
@@ -827,7 +827,7 @@ store_folder_deleted(CamelObject *o, gpointer event_data, gpointer data)
{
CamelStore *store = (CamelStore *)o;
CamelFolderInfo *info = event_data;
- FilterRule *rule;
+ EFilterRule *rule;
gchar *user;
d(printf("Folder deleted: %s\n", info->name));
@@ -838,20 +838,20 @@ store_folder_deleted(CamelObject *o, gpointer event_data, gpointer data)
G_LOCK (vfolder);
/* delete it from our list */
- rule = rule_context_find_rule((RuleContext *)context, info->full_name, NULL);
+ rule = e_rule_context_find_rule((ERuleContext *)context, info->full_name, NULL);
if (rule) {
const gchar *data_dir;
/* We need to stop listening to removed events, otherwise we'll try and remove it again */
g_signal_handlers_disconnect_matched(context, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0,
0, NULL, context_rule_removed, context);
- rule_context_remove_rule((RuleContext *)context, rule);
+ e_rule_context_remove_rule((ERuleContext *)context, rule);
g_object_unref(rule);
g_signal_connect(context, "rule_removed", G_CALLBACK(context_rule_removed), context);
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save((RuleContext *)context, user);
+ e_rule_context_save((ERuleContext *)context, user);
g_free(user);
} else {
g_warning("Cannot find rule for deleted vfolder '%s'", info->name);
@@ -864,7 +864,7 @@ static void
store_folder_renamed(CamelObject *o, gpointer event_data, gpointer data)
{
CamelRenameInfo *info = event_data;
- FilterRule *rule;
+ EFilterRule *rule;
gchar *user;
gpointer key, folder;
@@ -883,7 +883,7 @@ store_folder_renamed(CamelObject *o, gpointer event_data, gpointer data)
g_free (key);
g_hash_table_insert (vfolder_hash, g_strdup(info->new->full_name), folder);
- rule = rule_context_find_rule((RuleContext *)context, info->old_base, NULL);
+ rule = e_rule_context_find_rule((ERuleContext *)context, info->old_base, NULL);
if (!rule) {
G_UNLOCK (vfolder);
g_warning ("Rule shouldn't be NULL\n");
@@ -892,12 +892,12 @@ store_folder_renamed(CamelObject *o, gpointer event_data, gpointer data)
g_signal_handlers_disconnect_matched(rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0,
0, NULL, rule_changed, folder);
- filter_rule_set_name(rule, info->new->full_name);
+ e_filter_rule_set_name(rule, info->new->full_name);
g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder);
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save((RuleContext *)context, user);
+ e_rule_context_save((ERuleContext *)context, user);
g_free(user);
G_UNLOCK (vfolder);
@@ -915,7 +915,7 @@ vfolder_load_storage(void)
const gchar *data_dir;
gchar *user, *storeuri;
- FilterRule *rule;
+ EFilterRule *rule;
gchar *xmlfile;
GConfClient *gconf;
@@ -954,9 +954,9 @@ vfolder_load_storage(void)
context = em_vfolder_context_new ();
xmlfile = g_build_filename (EVOLUTION_PRIVDATADIR, "vfoldertypes.xml", NULL);
- if (rule_context_load ((RuleContext *)context,
+ if (e_rule_context_load ((ERuleContext *)context,
xmlfile, user) != 0) {
- g_warning("cannot load vfolders: %s\n", ((RuleContext *)context)->error);
+ g_warning("cannot load vfolders: %s\n", ((ERuleContext *)context)->error);
}
g_free (xmlfile);
g_free (user);
@@ -969,10 +969,10 @@ vfolder_load_storage(void)
/* and setup the rules we have */
rule = NULL;
- while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) {
+ while ( (rule = e_rule_context_next_rule((ERuleContext *)context, rule, NULL)) ) {
if (rule->name) {
d(printf("rule added: %s\n", rule->name));
- context_rule_added((RuleContext *)context, rule);
+ context_rule_added((ERuleContext *)context, rule);
} else {
d(printf("invalid rule (%p) encountered: rule->name is NULL\n", rule));
}
@@ -995,7 +995,7 @@ vfolder_revert(void)
d(printf("vfolder_revert\n"));
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_revert((RuleContext *)context, user);
+ e_rule_context_revert((ERuleContext *)context, user);
g_free(user);
}
@@ -1027,10 +1027,10 @@ vfolder_edit (EShellView *shell_view)
switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
case GTK_RESPONSE_OK:
- rule_context_save ((RuleContext *) context, filename);
+ e_rule_context_save ((ERuleContext *) context, filename);
break;
default:
- rule_context_revert ((RuleContext *) context, filename);
+ e_rule_context_revert ((ERuleContext *) context, filename);
break;
}
@@ -1043,13 +1043,13 @@ edit_rule_response(GtkWidget *w, gint button, gpointer data)
if (button == GTK_RESPONSE_OK) {
const gchar *data_dir;
gchar *user;
- FilterRule *rule = g_object_get_data (G_OBJECT (w), "rule");
- FilterRule *orig = g_object_get_data (G_OBJECT (w), "orig");
+ EFilterRule *rule = g_object_get_data (G_OBJECT (w), "rule");
+ EFilterRule *orig = g_object_get_data (G_OBJECT (w), "orig");
- filter_rule_copy(orig, rule);
+ e_filter_rule_copy(orig, rule);
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save((RuleContext *)context, user);
+ e_rule_context_save((ERuleContext *)context, user);
g_free(user);
}
@@ -1061,16 +1061,16 @@ vfolder_edit_rule(const gchar *uri)
{
GtkWidget *w;
GtkDialog *gd;
- FilterRule *rule, *newrule;
+ EFilterRule *rule, *newrule;
CamelURL *url;
url = camel_url_new(uri, NULL);
if (url && url->fragment
- && (rule = rule_context_find_rule((RuleContext *)context, url->fragment, NULL))) {
+ && (rule = e_rule_context_find_rule((ERuleContext *)context, url->fragment, NULL))) {
g_object_ref((GtkObject *)rule);
- newrule = filter_rule_clone(rule);
+ newrule = e_filter_rule_clone(rule);
- w = filter_rule_get_widget((FilterRule *)newrule, (RuleContext *)context);
+ w = e_filter_rule_get_widget((EFilterRule *)newrule, (ERuleContext *)context);
gd = (GtkDialog *)gtk_dialog_new_with_buttons(_("Edit Search Folder"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1108,44 +1108,44 @@ new_rule_clicked(GtkWidget *w, gint button, gpointer data)
if (button == GTK_RESPONSE_OK) {
const gchar *data_dir;
gchar *user;
- FilterRule *rule = g_object_get_data((GObject *)w, "rule");
+ EFilterRule *rule = g_object_get_data((GObject *)w, "rule");
- if (!filter_rule_validate (rule, GTK_WINDOW (w))) {
+ if (!e_filter_rule_validate (rule, GTK_WINDOW (w))) {
/* no need to popup a dialog because the validate code does that. */
return;
}
- if (rule_context_find_rule ((RuleContext *)context, rule->name, rule->source)) {
+ if (e_rule_context_find_rule ((ERuleContext *)context, rule->name, rule->source)) {
e_error_run ((GtkWindow *)w, "mail:vfolder-notunique", rule->name, NULL);
return;
}
g_object_ref(rule);
- rule_context_add_rule((RuleContext *)context, rule);
+ e_rule_context_add_rule((ERuleContext *)context, rule);
data_dir = em_utils_get_data_dir ();
user = g_build_filename (data_dir, "vfolders.xml", NULL);
- rule_context_save((RuleContext *)context, user);
+ e_rule_context_save((ERuleContext *)context, user);
g_free(user);
}
gtk_widget_destroy(w);
}
-FilterPart *
+EFilterPart *
vfolder_create_part(const gchar *name)
{
- return rule_context_create_part((RuleContext *)context, name);
+ return e_rule_context_create_part((ERuleContext *)context, name);
}
/* clones a filter/search rule into a matching vfolder rule (assuming the same system definitions) */
-FilterRule *
-vfolder_clone_rule(FilterRule *in)
+EFilterRule *
+vfolder_clone_rule(EFilterRule *in)
{
- FilterRule *rule = (FilterRule *)em_vfolder_rule_new();
+ EFilterRule *rule = (EFilterRule *)em_vfolder_rule_new();
xmlNodePtr xml;
- xml = filter_rule_xml_encode(in);
- filter_rule_xml_decode(rule, xml, (RuleContext *)context);
+ xml = e_filter_rule_xml_encode(in);
+ e_filter_rule_xml_decode(rule, xml, (ERuleContext *)context);
xmlFreeNodeList(xml);
return rule;
@@ -1161,7 +1161,7 @@ vfolder_gui_add_rule(EMVFolderRule *rule)
/* this should be done before we call this function */
vfolder_load_storage ();
- w = filter_rule_get_widget((FilterRule *)rule, (RuleContext *)context);
+ w = e_filter_rule_get_widget((EFilterRule *)rule, (ERuleContext *)context);
gd = (GtkDialog *)gtk_dialog_new_with_buttons(_("New Search Folder"),
NULL,
diff --git a/mail/mail-vfolder.h b/mail/mail-vfolder.h
index b3299ab834..725f7ec348 100644
--- a/mail/mail-vfolder.h
+++ b/mail/mail-vfolder.h
@@ -25,8 +25,8 @@
#include <camel/camel-internet-address.h>
#include <camel/camel-mime-message.h>
-#include <filter/filter-part.h>
-#include <filter/filter-rule.h>
+#include <filter/e-filter-part.h>
+#include <filter/e-filter-rule.h>
#include <mail/em-vfolder-rule.h>
#include <shell/e-shell-view.h>
@@ -35,8 +35,8 @@ void vfolder_revert(void);
void vfolder_edit (EShellView *shell_view);
void vfolder_edit_rule(const gchar *name);
-FilterPart *vfolder_create_part (const gchar *name);
-FilterRule *vfolder_clone_rule (FilterRule *in);
+EFilterPart *vfolder_create_part (const gchar *name);
+EFilterRule *vfolder_clone_rule (EFilterRule *in);
void vfolder_gui_add_rule (EMVFolderRule *rule);
void vfolder_gui_add_from_message (CamelMimeMessage *msg, gint flags, const gchar *source);
void vfolder_gui_add_from_address (CamelInternetAddress *addr, gint flags, const gchar *source);