Mercurial > pidgin
comparison pidgin/plugins/vvconfig.c @ 32665:a92f4cb593a4
propagate from branch 'im.pidgin.pidgin' (head c0e633bbd723352b9614b1bfcfab551e416a29dc)
to branch 'im.pidgin.cpw.qulogic.gtk3' (head 1887cd5f7ea1e4bc0950747da36d56d618ecd105)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Wed, 02 Feb 2011 23:26:42 +0000 |
parents | a7397a3d67ef 2b63df6e495c |
children | e2a1510da13d |
comparison
equal
deleted
inserted
replaced
32648:a7397a3d67ef | 32665:a92f4cb593a4 |
---|---|
80 GstElement *element; | 80 GstElement *element; |
81 GObjectClass *klass; | 81 GObjectClass *klass; |
82 GstPropertyProbe *probe; | 82 GstPropertyProbe *probe; |
83 const GParamSpec *pspec; | 83 const GParamSpec *pspec; |
84 | 84 |
85 if (!strcmp(element_name, "<custom>")) { | |
86 ret = g_list_prepend(ret, NULL); | |
87 ret = g_list_prepend(ret, (gpointer)_("Default")); | |
88 ret = g_list_prepend(ret, ""); | |
89 return ret; | |
90 } | |
91 | |
92 ret = g_list_prepend(ret, (gpointer)_("Default")); | 85 ret = g_list_prepend(ret, (gpointer)_("Default")); |
93 ret = g_list_prepend(ret, ""); | 86 ret = g_list_prepend(ret, ""); |
94 | 87 |
95 if (*element_name == '\0') { | 88 if (!strcmp(element_name, "<custom>") || (*element_name == '\0')) { |
96 ret = g_list_prepend(ret, NULL); | 89 return g_list_reverse(ret); |
97 ret = g_list_reverse(ret); | |
98 return ret; | |
99 } | 90 } |
100 | 91 |
101 element = gst_element_factory_make(element_name, "test"); | 92 element = gst_element_factory_make(element_name, "test"); |
102 klass = G_OBJECT_GET_CLASS (element); | 93 klass = G_OBJECT_GET_CLASS (element); |
103 if (!g_object_class_find_property(klass, "device") || | 94 if (!g_object_class_find_property(klass, "device") || |
118 } | 109 } |
119 | 110 |
120 array = gst_property_probe_probe_and_get_values (probe, pspec); | 111 array = gst_property_probe_probe_and_get_values (probe, pspec); |
121 if (array == NULL) { | 112 if (array == NULL) { |
122 purple_debug_info("vvconfig", "'%s' has no devices\n", element_name); | 113 purple_debug_info("vvconfig", "'%s' has no devices\n", element_name); |
123 ret = g_list_prepend(ret, NULL); | 114 return g_list_reverse(ret); |
124 ret = g_list_reverse(ret); | |
125 return ret; | |
126 } | 115 } |
127 | 116 |
128 for (n=0; n < array->n_values; ++n) { | 117 for (n=0; n < array->n_values; ++n) { |
129 GValue *device; | 118 GValue *device; |
130 const gchar *name; | 119 const gchar *name; |
151 gst_element_set_state(element, GST_STATE_NULL); | 140 gst_element_set_state(element, GST_STATE_NULL); |
152 } | 141 } |
153 } | 142 } |
154 gst_object_unref(element); | 143 gst_object_unref(element); |
155 | 144 |
156 ret = g_list_prepend(ret, NULL); | 145 return g_list_reverse(ret); |
157 ret = g_list_reverse(ret); | |
158 | |
159 return ret; | |
160 } | 146 } |
161 | 147 |
162 static GList * | 148 static GList * |
163 get_element_plugins(const gchar **plugins) | 149 get_element_plugins(const gchar **plugins) |
164 { | 150 { |
171 plugins[0], 0, 0, 0)) { | 157 plugins[0], 0, 0, 0)) { |
172 ret = g_list_prepend(ret, (gpointer)plugins[1]); | 158 ret = g_list_prepend(ret, (gpointer)plugins[1]); |
173 ret = g_list_prepend(ret, (gpointer)plugins[0]); | 159 ret = g_list_prepend(ret, (gpointer)plugins[0]); |
174 } | 160 } |
175 } | 161 } |
176 ret = g_list_prepend(ret, NULL); | |
177 ret = g_list_reverse(ret); | 162 ret = g_list_reverse(ret); |
178 return ret; | 163 return ret; |
179 } | 164 } |
180 | 165 |
181 static void | 166 static void |
234 gtk_widget_destroy(widget); | 219 gtk_widget_destroy(widget); |
235 | 220 |
236 pref = g_strdup(name); | 221 pref = g_strdup(name); |
237 strcpy(pref + strlen(pref) - strlen("plugin"), "device"); | 222 strcpy(pref + strlen(pref) - strlen("plugin"), "device"); |
238 devices = get_element_devices(value); | 223 devices = get_element_devices(value); |
239 if (g_list_find(devices, purple_prefs_get_string(pref)) == NULL) | 224 if (g_list_find_custom(devices, purple_prefs_get_string(pref), |
225 (GCompareFunc)strcmp) == NULL) | |
240 purple_prefs_set_string(pref, g_list_next(devices)->data); | 226 purple_prefs_set_string(pref, g_list_next(devices)->data); |
241 widget = pidgin_prefs_dropdown_from_list(parent, | 227 widget = pidgin_prefs_dropdown_from_list(parent, |
242 label, PURPLE_PREF_STRING, | 228 label, PURPLE_PREF_STRING, |
243 pref, devices); | 229 pref, devices); |
244 g_list_free(devices); | 230 g_list_free(devices); |