diff options
author | Nick Schermer <nick@xfce.org> | 2010-02-08 18:44:58 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2010-02-08 19:54:14 +0100 |
commit | 3451406146461eda8548c6561432dad35b8c6214 (patch) | |
tree | fdbd72083f73e9b5ca2385a5fb2b4c84d7c45584 /xfconfd | |
parent | 128fad2d48fbaf23254249a4ec43587bf5958735 (diff) | |
download | xfconf-3451406146461eda8548c6561432dad35b8c6214.tar.gz |
Use g_clear_error where possible.
Diffstat (limited to 'xfconfd')
-rw-r--r-- | xfconfd/xfconf-backend-perchannel-xml.c | 10 | ||||
-rw-r--r-- | xfconfd/xfconf-daemon.c | 29 |
2 files changed, 12 insertions, 27 deletions
diff --git a/xfconfd/xfconf-backend-perchannel-xml.c b/xfconfd/xfconf-backend-perchannel-xml.c index 5ac5dae..324938f 100644 --- a/xfconfd/xfconf-backend-perchannel-xml.c +++ b/xfconfd/xfconf-backend-perchannel-xml.c @@ -309,10 +309,7 @@ xfconf_backend_perchannel_xml_set(XfconfBackend *backend, #endif if(!channel) { #ifdef XFCONF_ENABLE_CHECKS - if(error && *error) { - g_error_free(*error); - *error = NULL; - } + g_clear_error(error); #endif channel = xfconf_backend_perchannel_xml_create_channel(xbpx, channel_name); @@ -511,10 +508,7 @@ xfconf_backend_perchannel_xml_exists(XfconfBackend *backend, #endif if(!channel) { #ifdef XFCONF_ENABLE_CHECKS - if(error && *error) { - g_error_free(*error); - *error = NULL; - } + g_clear_error(error); #endif *exists = FALSE; diff --git a/xfconfd/xfconf-daemon.c b/xfconfd/xfconf-daemon.c index ba5ea96..c023f86 100644 --- a/xfconfd/xfconf-daemon.c +++ b/xfconfd/xfconf-daemon.c @@ -270,10 +270,8 @@ xfconf_get_property(XfconfDaemon *xfconfd, for(l = xfconfd->backends; l; l = l->next) { if(xfconf_backend_get(l->data, channel, property, value, error)) return TRUE; - else if(l->next && error && *error) { - g_error_free(*error); - *error = NULL; - } + else if(l->next) + g_clear_error(error); } return FALSE; @@ -301,10 +299,8 @@ xfconf_get_all_properties(XfconfDaemon *xfconfd, *properties, error)) { ret = TRUE; - } else if(l->next && error && *error) { - g_error_free(*error); - *error = NULL; - } + } else if(l->next) + g_clear_error(error); } if(!ret) { @@ -336,10 +332,8 @@ xfconf_property_exists(XfconfDaemon *xfconfd, *exists = exists_tmp; if(*exists) return TRUE; - } else if(l->next && error && *error) { - g_error_free(*error); - *error = NULL; - } + } else if(l->next) + g_clear_error(error); } return ret; @@ -362,10 +356,8 @@ xfconf_reset_property(XfconfDaemon *xfconfd, for(l = xfconfd->backends; l; l = l->next) { if(xfconf_backend_reset(l->data, channel, property, recursive, error)) ret = TRUE; - else if(l->next && error && *error) { - g_error_free(*error); - *error = NULL; - } + else if(l->next) + g_clear_error(error); } return ret; @@ -385,7 +377,7 @@ xfconf_list_channels(XfconfDaemon *xfconfd, chans_tmp = NULL; if(xfconf_backend_list_channels(l->data, &chans_tmp, error)) lchannels = g_slist_concat(lchannels, chans_tmp); - else if(error) + else g_clear_error(error); } @@ -480,8 +472,7 @@ xfconf_daemon_load_config(XfconfDaemon *xfconfd, if(!backend) { g_warning("Unable to start backend \"%s\": %s", backend_ids[i], error1->message); - g_error_free(error1); - error1 = NULL; + g_clear_error(&error1); } else { xfconfd->backends = g_list_prepend(xfconfd->backends, backend); xfconf_backend_register_property_changed_func(backend, |