void
mate_panel_applet_mateconf_set_list (MatePanelApplet     *applet,
			     const gchar     *key,
			     MateConfValueType   list_type,
			     GSList          *list,
			     GError         **opt_error)
{
	MateConfClient  *client;
	gchar        *full_key;
	GError      **error = NULL;
	GError       *our_error = NULL;

	g_return_if_fail (PANEL_IS_APPLET (applet));

	if (opt_error)
		error = opt_error;
	else
		error = &our_error;

	full_key = mate_panel_applet_mateconf_get_full_key (applet, key);

	client = mate_panel_applet_mateconf_get_client ();

	mateconf_client_set_list (client, full_key, list_type, list, error);

	g_free (full_key);

	if (!opt_error && our_error) {
		g_warning (G_STRLOC ": mateconf error : '%s'", our_error->message);
		g_error_free (our_error);
	}
}
static void
mateconf_bookmarks_dialog_update_mateconf_key (MateConfBookmarksDialog *dialog)
{
	GSList *list;
	GtkTreeIter iter;
	char *bookmark;
	MateConfClient *client;
	
	list = NULL;

	if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->list_store), &iter)) {
		do {
			gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store), &iter,
					    0, &bookmark,
					    -1);
			list = g_slist_append (list, bookmark);
		} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->list_store), &iter));
	}

	client = mateconf_client_get_default ();

	dialog->changing_key = TRUE;
	mateconf_client_set_list (client, BOOKMARKS_KEY,
			       MATECONF_VALUE_STRING, list, NULL);

	g_object_unref (client);
}
void
mateconf_bookmarks_add_bookmark (const char *path)
{
	GSList *list, *tmp;
	MateConfClient *client;

	client = mateconf_client_get_default ();

	/* Get the old list and then set it */
	list = mateconf_client_get_list (client,
				     "/apps/mateconf-editor/bookmarks", MATECONF_VALUE_STRING, NULL);

	/* FIXME: We need error handling here, also this function leaks memory */

	/* Check that the bookmark hasn't been added already */
	for (tmp = list; tmp; tmp = tmp->next) {
		if (strcmp (tmp->data, path) == 0) {
			g_slist_free (list);
			return;
		}
	}

	/* Append the new bookmark */
	list = g_slist_append (list, g_strdup (path));
	
	mateconf_client_set_list (client,
			       "/apps/mateconf-editor/bookmarks", MATECONF_VALUE_STRING, list, NULL);
	g_slist_free (list);
	g_object_unref (client);
}
static void
desktop_set_metadata_stringv (GFile *file,
                              const char *key,
                              char **stringv)
{
    MateConfClient *client;
    char *mateconf_key;
    GSList *list;
    int i;
    GFile *parent;
    char *name;

    parent = g_file_get_parent (file);
    if (parent == NULL)
    {
        name = g_strdup ("directory");
    }
    else
    {
        g_object_unref (parent);
        name = g_file_get_basename (file);
    }

    client = mateconf_client_get_default ();
    mateconf_key = get_metadata_mateconf_path (name, key);

    list = NULL;
    for (i = 0; stringv[i] != NULL; i++)
    {
        list = g_slist_prepend (list, stringv[i]);
    }
    list = g_slist_reverse (list);

    mateconf_client_set_list (client, mateconf_key,
                              MATECONF_VALUE_STRING,
                              list, NULL);

    g_slist_free (list);
    g_free (mateconf_key);
    g_free (name);
    g_object_unref (client);
}
static void
gn_combo_history_mateconf_save (GnComboHistory *history)
{
	gchar  *key;
   
	g_return_if_fail (GN_IS_COMBO_HISTORY (history));
	g_return_if_fail (history->priv->mateconf_client != NULL);
	g_return_if_fail (history->priv->id != NULL);

	key = g_strconcat ("/apps/mate-settings/",
			   "mate-nettool",
			   "/history-",
			   history->priv->id,
			   NULL);

	mateconf_client_set_list (history->priv->mateconf_client,
			       key, MATECONF_VALUE_STRING,
			       history->priv->items, NULL);

	g_free (key);
}