diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-11-25 07:35:39 +0800 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-01 03:31:19 +0800 |
commit | ae906bbae5b053fad7f5425c242530e33f589f68 (patch) | |
tree | 31b46cdbdd341dadcdbd857fb0fabc3e87a798ec /mail/em-vfolder-rule.c | |
parent | ac1f847f7b40b3a0f6ed00dedd2eb2b0f23b5027 (diff) | |
download | gsoc2013-evolution-ae906bbae5b053fad7f5425c242530e33f589f68.tar.gz gsoc2013-evolution-ae906bbae5b053fad7f5425c242530e33f589f68.tar.zst gsoc2013-evolution-ae906bbae5b053fad7f5425c242530e33f589f68.zip |
port mail/ to use new EError API
https://bugzilla.gnome.org/show_bug.cgi?id=602963
Diffstat (limited to 'mail/em-vfolder-rule.c')
-rw-r--r-- | mail/em-vfolder-rule.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index ea275795cc..c7cf0845b8 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -44,7 +44,7 @@ #define d(x) -static gint validate(EFilterRule *, GtkWindow *error_parent); +static gint validate(EFilterRule *, EError **error); static gint vfolder_eq(EFilterRule *fr, EFilterRule *cm); static xmlNodePtr xml_encode(EFilterRule *); static gint xml_decode(EFilterRule *, xmlNodePtr, ERuleContext *f); @@ -101,7 +101,7 @@ em_vfolder_rule_class_init(EMVFolderRuleClass *klass) object_class->finalize = em_vfolder_rule_finalise; /* override methods */ - fr_class->validate = validate; + fr_class->validate = validate; fr_class->eq = vfolder_eq; fr_class->xml_encode = xml_encode; fr_class->xml_decode = xml_decode; @@ -208,23 +208,26 @@ em_vfolder_rule_next_source(EMVFolderRule *vr, const gchar *last) } static gint -validate(EFilterRule *fr, GtkWindow *error_parent) +validate(EFilterRule *fr, EError **error) { g_return_val_if_fail(fr != NULL, 0); + g_warn_if_fail (error == NULL || *error == NULL); if (!fr->name || !*fr->name) { - e_error_run (error_parent, "mail:no-name-vfolder", NULL); + if (error) + *error = e_error_new ("mail:no-name-vfolder", NULL); return 0; } /* We have to have at least one source set in the "specific" case. Do not translate this string! */ if (((EMVFolderRule *)fr)->with == EM_VFOLDER_RULE_WITH_SPECIFIC && ((EMVFolderRule *)fr)->sources == NULL) { - e_error_run (error_parent, "mail:vfolder-no-source", NULL); + if (error) + *error = e_error_new ("mail:vfolder-no-source", NULL); return 0; } - return E_FILTER_RULE_CLASS(parent_class)->validate (fr, error_parent); + return E_FILTER_RULE_CLASS(parent_class)->validate (fr, error); } static gint |