diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-18 09:29:08 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-18 09:29:08 -0500 |
commit | 54b21fbdf26c6b55dfc353238696fd4ada1609f7 (patch) | |
tree | 9b941409c839d68a09cd9a7076ff41c0f2541d74 | |
parent | 2b461cbadb7d48c22625a5b8435dc0ea8314f948 (diff) | |
download | ayatana-indicator-datetime-54b21fbdf26c6b55dfc353238696fd4ada1609f7.tar.gz ayatana-indicator-datetime-54b21fbdf26c6b55dfc353238696fd4ada1609f7.tar.bz2 ayatana-indicator-datetime-54b21fbdf26c6b55dfc353238696fd4ada1609f7.zip |
minor: use g_clear_error() instead of g_error_free()
-rw-r--r-- | src/datetime-service.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 7668689..ecf2807 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -273,7 +273,7 @@ quick_set_tz_cb (GObject *object, GAsyncResult *res, gpointer data) if (error != NULL) { g_warning("Could not set timezone for SettingsDaemon: %s", error->message); - g_error_free(error); + g_clear_error (&error); return; } @@ -289,7 +289,7 @@ quick_set_tz_proxy_cb (GObject *object, GAsyncResult *res, gpointer zone) if (error != NULL) { g_warning("Could not grab DBus proxy for SettingsDaemon: %s", error->message); - g_error_free(error); + g_clear_error (&error); g_free (zone); return; } @@ -363,7 +363,7 @@ execute_command (const gchar * command) g_debug("Issuing command '%s'", command); if (!g_spawn_command_line_async(command, &error)) { g_warning("Unable to start %s: %s", (char *)command, error->message); - g_error_free(error); + g_clear_error (&error); } } @@ -737,8 +737,7 @@ update_appointment_menu_items (gpointer user_data) GSList *cal_list = gconf_client_get_list(gconf, "/apps/evolution/calendar/display/selected_calendars", GCONF_VALUE_STRING, &gerror); if (gerror) { g_debug("Failed to get evolution preference for enabled calendars"); - g_error_free(gerror); - gerror = NULL; + g_clear_error (&gerror); cal_list = NULL; } @@ -760,16 +759,14 @@ update_appointment_menu_items (gpointer user_data) } if (current_zone && !e_cal_set_default_timezone(ecal, current_zone, &gerror)) { g_debug("Failed to set ecal default timezone %s", gerror->message); - g_error_free(gerror); - gerror = NULL; + g_clear_error (&gerror); g_object_unref(ecal); continue; } if (!e_cal_open(ecal, FALSE, &gerror)) { g_debug("Failed to get ecal sources %s", gerror->message); - g_error_free(gerror); - gerror = NULL; + g_clear_error (&gerror); g_object_unref(ecal); continue; } @@ -1010,7 +1007,8 @@ update_appointment_menu_items (gpointer user_data) g_debug("Adding appointment: %p", item); } - if (gerror != NULL) g_error_free(gerror); + g_clear_error (&gerror); + for (l = sorted_comp_instances; l; l = l->next) { const struct comp_instance *ci = l->data; g_object_unref(ci->comp); @@ -1205,7 +1203,7 @@ system_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) if (error != NULL) { g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message); - g_error_free(error); + g_clear_error (&error); return; } |