aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorYan Li <yanli@infradead.org>2009-11-17 14:40:48 +0800
committerYan Li <yanli@infradead.org>2009-11-17 14:40:48 +0800
commit5f56c47b373638798102a756bd7bffe98d1e300d (patch)
treeb4f8ed3276333e6002eaf5d9334d9e28bba6edc8 /filter
parent054c0881696a85f537e93b4950a28f505a3dc0f7 (diff)
downloadgsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar.gz
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar.bz2
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar.lz
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar.xz
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.tar.zst
gsoc2013-evolution-5f56c47b373638798102a756bd7bffe98d1e300d.zip
Bug #592294 - Output an error message on system filter rules loading error
Without that the user/developer has no way to know when the loading failed. (ported from gnome-2-28 1dcda85)
Diffstat (limited to 'filter')
-rw-r--r--filter/e-rule-context.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c
index 648011b8e5..5167abbde6 100644
--- a/filter/e-rule-context.c
+++ b/filter/e-rule-context.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -197,14 +198,21 @@ rule_context_load (ERuleContext *context,
systemdoc = e_xml_parse_file (system);
if (systemdoc == NULL) {
- rule_context_set_error (context, g_strdup_printf ("Unable to load system rules '%s': %s",
- system, g_strerror (errno)));
+ gchar * err_msg = g_strdup_printf("Unable to load system rules '%s': %s",
+ system, g_strerror(errno));
+ g_warning(err_msg);
+ rule_context_set_error(context, err_msg);
+ /* no need to free err_msg here */
return -1;
}
root = xmlDocGetRootElement (systemdoc);
if (root == NULL || strcmp ((gchar *)root->name, "filterdescription")) {
- rule_context_set_error (context, g_strdup_printf ("Unable to load system rules '%s': Invalid format", system));
+ gchar * err_msg = g_strdup_printf ("Unable to load system rules '%s': Invalid format",
+ system);
+ g_warning(err_msg);
+ rule_context_set_error(context, err_msg);
+ /* no need to free err_msg here */
xmlFreeDoc (systemdoc);
return -1;
}