mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 18:35:35 +00:00
some fixes, suggestion by thaytan to make _get and _set work similar
Original commit message from CVS: some fixes, suggestion by thaytan to make _get and _set work similar
This commit is contained in:
parent
8dfaefdbe3
commit
5b8cf51087
1 changed files with 18 additions and 7 deletions
|
@ -62,23 +62,34 @@ gst_gconf_get_string (const gchar *key)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gchar *value = NULL;
|
gchar *value = NULL;
|
||||||
gchar *full_key = g_strdup_printf ("%s/%s", GST_GCONF_DIR, key);
|
gchar *full_key = g_strdup_printf ("%s/%s", GST_GCONF_DIR, key);
|
||||||
|
|
||||||
|
|
||||||
value = gconf_client_get_string (gst_gconf_get_client (), full_key, &error);
|
value = gconf_client_get_string (gst_gconf_get_client (), full_key, &error);
|
||||||
g_free (full_key);
|
g_free (full_key);
|
||||||
|
|
||||||
if (value)
|
if (error)
|
||||||
return value;
|
{
|
||||||
else
|
g_warning ("gst_gconf_get_string: error: %s\n", error->message);
|
||||||
return NULL;
|
g_error_free (error);
|
||||||
// this is a good idea: return g_strdup (default_val);
|
}
|
||||||
|
/* FIXME: decide if we want to strdup this value; if we do, check for NULL */
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_gconf_set_string (const gchar *key, const gchar *value)
|
gst_gconf_set_string (const gchar *key, const gchar *value)
|
||||||
{
|
{
|
||||||
gconf_client_set_string (gst_gconf_get_client (), key, value, NULL);
|
GError *error = NULL;
|
||||||
|
gchar *full_key = g_strdup_printf ("%s/%s", GST_GCONF_DIR, key);
|
||||||
|
|
||||||
|
gconf_client_set_string (gst_gconf_get_client (), full_key, value, &error);
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
g_warning ("gst_gconf_set_string: error: %s\n", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
|
g_free (full_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this function renders the given description to a bin,
|
/* this function renders the given description to a bin,
|
||||||
|
|
Loading…
Reference in a new issue