[goffice] remove some over-zealous g_return_if_fail
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] remove some over-zealous g_return_if_fail
- Date: Wed, 25 Aug 2010 01:40:47 +0000 (UTC)
commit 3eecb57d0049da9af0c330073e2249e4c338508e
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Tue Aug 24 19:40:21 2010 -0600
remove some over-zealous g_return_if_fail
2010-08-24 Andreas J. Guelzow <aguelzow pyrshep ca>
* goffice/app/io-context.c (go_io_error_info_set): don't be overzealous
while checking for problems
(go_io_error_push): skip useless code
ChangeLog | 6 ++++++
goffice/app/error-info.h | 2 +-
goffice/app/io-context.c | 15 ++++++++-------
3 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 661915c..4885e76 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2010-08-24 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * goffice/app/io-context.c (go_io_error_info_set): don't be overzealous
+ while checking for problems
+ (go_io_error_push): skip useless code
+
+2010-08-24 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* goffice/app/go-cmd-context-impl.h (error_info_list): new method
* goffice/app/go-cmd-context.c (go_cmd_context_error_info_list):
call error_info_list
diff --git a/goffice/app/error-info.h b/goffice/app/error-info.h
index 24e9172..862a400 100644
--- a/goffice/app/error-info.h
+++ b/goffice/app/error-info.h
@@ -21,7 +21,7 @@ GOErrorInfo *go_error_info_new_str_with_details_list (char const *msg, GSList *d
GOErrorInfo *go_error_info_new_from_error_list (GSList *errors);
GOErrorInfo *go_error_info_new_from_errno (void);
void go_error_info_add_details (GOErrorInfo *error, GOErrorInfo *details);
-void go_error_info_add_details_list (GOErrorInfo *error, GSList *details);
+void go_error_info_add_details_list (GOErrorInfo *error, GSList *details);
void go_error_info_free (GOErrorInfo *error);
void go_error_info_print (GOErrorInfo *error);
char const*go_error_info_peek_message (GOErrorInfo *error);
diff --git a/goffice/app/io-context.c b/goffice/app/io-context.c
index 4f2a1a0..36fd8d0 100644
--- a/goffice/app/io-context.c
+++ b/goffice/app/io-context.c
@@ -191,10 +191,12 @@ go_io_error_info_set (GOIOContext *context, GOErrorInfo *error)
g_return_if_fail (context != NULL);
g_return_if_fail (error != NULL);
- g_return_if_fail (context->info == NULL);
-
context->info = g_slist_prepend (context->info, error);
- context->error_occurred = TRUE;
+
+ if (go_error_info_peek_severity (error) < GO_ERROR)
+ context->warning_occurred = TRUE;
+ else
+ context->error_occurred = TRUE;
}
void
@@ -203,10 +205,9 @@ go_io_error_push (GOIOContext *context, GOErrorInfo *error)
g_return_if_fail (context != NULL);
g_return_if_fail (error != NULL);
- if (context->info == NULL) {
- go_error_info_add_details (error, NULL);
- context->info = g_slist_append (NULL, error);
- } else {
+ if (context->info == NULL)
+ go_io_error_info_set (context, error);
+ else {
GOErrorInfo *info = context->info->data;
go_error_info_add_details (error, info);
context->info->data = error;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]