Mercurial > audlegacy
comparison src/libaudclient/audctrl.c @ 3901:2bb32f15569e
some cleanups
| author | William Pitcock <nenolod@atheme.org> |
|---|---|
| date | Tue, 06 Nov 2007 12:33:03 -0600 |
| parents | 44ab3d6057da |
| children | 86c9abc83fbd |
comparison
equal
deleted
inserted
replaced
| 3900:44ab3d6057da | 3901:2bb32f15569e |
|---|---|
| 962 * | 962 * |
| 963 * Return value: The requested field's data for the entry in the playlist at %pos position. | 963 * Return value: The requested field's data for the entry in the playlist at %pos position. |
| 964 **/ | 964 **/ |
| 965 gchar *audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field, | 965 gchar *audacious_get_tuple_field_data(DBusGProxy *proxy, gchar *field, |
| 966 guint pos) { | 966 guint pos) { |
| 967 GValue value; | 967 GValue value = {}; |
| 968 gchar *s = NULL; | 968 gchar *s = NULL; |
| 969 | 969 |
| 970 org_atheme_audacious_song_tuple(proxy, pos, field, &value, &error); | 970 org_atheme_audacious_song_tuple(proxy, pos, field, &value, &error); |
| 971 | 971 |
| 972 g_clear_error(&error); | 972 g_clear_error(&error); |
| 976 | 976 |
| 977 if (G_VALUE_HOLDS_STRING(&value)) | 977 if (G_VALUE_HOLDS_STRING(&value)) |
| 978 s = g_strescape(g_value_get_string(&value), NULL); | 978 s = g_strescape(g_value_get_string(&value), NULL); |
| 979 else if (g_value_type_transformable(G_VALUE_TYPE(&value), G_TYPE_STRING)) | 979 else if (g_value_type_transformable(G_VALUE_TYPE(&value), G_TYPE_STRING)) |
| 980 { | 980 { |
| 981 GValue tmp_value = {}; | 981 GValue tmp_value = { 0, }; |
| 982 | 982 |
| 983 g_value_init(&tmp_value, G_TYPE_STRING); | 983 g_value_init(&tmp_value, G_TYPE_STRING); |
| 984 g_value_transform(&value, &tmp_value); | 984 g_value_transform(&value, &tmp_value); |
| 985 | 985 |
| 986 s = g_strescape(g_value_get_string(&tmp_value), NULL); | 986 s = g_strescape(g_value_get_string(&tmp_value), NULL); |
| 989 } | 989 } |
| 990 else | 990 else |
| 991 s = g_strdup("<unknown type>"); | 991 s = g_strdup("<unknown type>"); |
| 992 | 992 |
| 993 g_value_unset(&value); | 993 g_value_unset(&value); |
| 994 | |
| 995 return s; | 994 return s; |
| 996 } | 995 } |
| 997 | 996 |
