void mateconf_sources_free(MateConfSources* sources) { GList* tmp; tmp = sources->sources; while (tmp != NULL) { mateconf_source_free(tmp->data); tmp = g_list_next(tmp); } g_list_free(sources->sources); g_free(sources); }
static gboolean check_mateconf (gboolean display_errors) { GSList* addresses; GSList* tmp; gchar* conffile; GError* error; gboolean retval; retval = FALSE; conffile = NULL; /* If mateconfd is already running, it's expected that we won't be able * to get locks etc., and everything is already fine. * Plus we can skip the slow sanity checks like resolve_address. */ if (mateconf_ping_daemon ()) { retval = TRUE; goto out; } conffile = g_build_filename (MATECONF_CONFDIR, "path", NULL); error = NULL; addresses = mateconf_load_source_path (conffile, &error); if (addresses == NULL) { if (display_errors) show_fatal_error_dialog (_("Please contact your system administrator to resolve the following problem:\n" "No configuration sources in the configuration file \"%s\"; this means that preferences and other settings can't be saved. %s%s"), conffile, error ? _("Error reading the file: ") : "", error ? error->message : ""); if (error) g_error_free (error); goto out; } tmp = addresses; while (tmp != NULL) { MateConfSource *source; const char *address; address = tmp->data; error = NULL; source = mateconf_resolve_address (address, &error); if (error) { if (display_errors) show_fatal_error_dialog (_("Please contact your system administrator to resolve the following problem:\n" "Could not resolve the address \"%s\" in the configuration file \"%s\": %s"), address, conffile, error->message); g_error_free (error); goto out; } mateconf_source_free (source); g_free (tmp->data); tmp = tmp->next; } g_slist_free (addresses); retval = TRUE; out: g_free (conffile); return retval; }