diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-08-31 13:24:51 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-08-31 13:24:51 +0800 |
commit | e7d6ad6d83acd3aba0dc11d4955339b20ccc8cf3 (patch) | |
tree | a3bc6a92164f3659ae93f5ff168ef3eed924926c /mail/em-vfolder-rule.c | |
parent | 9ea10deea3b27d7bde1b82792cae76b99b5610f6 (diff) | |
download | gsoc2013-evolution-e7d6ad6d83acd3aba0dc11d4955339b20ccc8cf3.tar.gz gsoc2013-evolution-e7d6ad6d83acd3aba0dc11d4955339b20ccc8cf3.tar.zst gsoc2013-evolution-e7d6ad6d83acd3aba0dc11d4955339b20ccc8cf3.zip |
** Move away from g_assert to g_return* calls
svn path=/trunk/; revision=34143
Diffstat (limited to 'mail/em-vfolder-rule.c')
-rw-r--r-- | mail/em-vfolder-rule.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index f8dbf8e593..0852712a08 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -142,7 +142,7 @@ em_vfolder_rule_new(void) void em_vfolder_rule_add_source(EMVFolderRule *vr, const char *uri) { - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_if_fail (EM_IS_VFOLDER_RULE(vr)); g_return_if_fail (uri); vr->sources = g_list_append(vr->sources, g_strdup(uri)); @@ -155,7 +155,7 @@ em_vfolder_rule_find_source(EMVFolderRule *vr, const char *uri) { GList *l; - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_val_if_fail (EM_IS_VFOLDER_RULE(vr), NULL); /* only does a simple string or address comparison, should probably do a decoded url comparison */ @@ -174,7 +174,7 @@ em_vfolder_rule_remove_source(EMVFolderRule *vr, const char *uri) { char *found; - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_if_fail (EM_IS_VFOLDER_RULE(vr)); found =(char *)em_vfolder_rule_find_source(vr, uri); if (found) { @@ -256,9 +256,11 @@ xml_encode(FilterRule *fr) EMVFolderRule *vr =(EMVFolderRule *)fr; xmlNodePtr node, set, work; GList *l; + node = FILTER_RULE_CLASS(parent_class)->xml_encode(fr); - g_assert(node != NULL); - g_assert(vr->with >= 0 && vr->with < sizeof(with_names)/sizeof(with_names[0])); + g_return_val_if_fail (node != NULL, NULL); + g_return_val_if_fail (vr->with >= 0 && vr->with < sizeof(with_names)/sizeof(with_names[0]), NULL); + set = xmlNewNode(NULL, (const unsigned char *)"sources"); xmlAddChild(node, set); xmlSetProp(set, (const unsigned char *)"with", (unsigned char *)with_names[vr->with]); |