| 140 } |
140 } |
| 141 |
141 |
| 142 void |
142 void |
| 143 purple_plugin_pref_destroy(PurplePluginPref *pref) |
143 purple_plugin_pref_destroy(PurplePluginPref *pref) |
| 144 { |
144 { |
| |
145 GList *tmp; |
| 145 g_return_if_fail(pref != NULL); |
146 g_return_if_fail(pref != NULL); |
| 146 |
147 |
| 147 g_free(pref->name); |
148 g_free(pref->name); |
| 148 g_free(pref->label); |
149 g_free(pref->label); |
| |
150 tmp = pref->choices; |
| |
151 while(tmp) { |
| |
152 g_free(tmp->data); |
| |
153 /* Remove the string, and the data entries */ |
| |
154 tmp = g_list_delete_link(tmp, tmp); |
| |
155 tmp = g_list_delete_link(tmp, tmp); |
| |
156 } |
| |
157 |
| 149 g_list_free(pref->choices); |
158 g_list_free(pref->choices); |
| 150 g_free(pref); |
159 g_free(pref); |
| 151 } |
160 } |
| 152 |
161 |
| 153 void |
162 void |
| 251 { |
260 { |
| 252 g_return_if_fail(pref != NULL); |
261 g_return_if_fail(pref != NULL); |
| 253 g_return_if_fail(label != NULL); |
262 g_return_if_fail(label != NULL); |
| 254 g_return_if_fail(choice || purple_prefs_get_type(pref->name) == PURPLE_PREF_INT); |
263 g_return_if_fail(choice || purple_prefs_get_type(pref->name) == PURPLE_PREF_INT); |
| 255 |
264 |
| 256 pref->choices = g_list_append(pref->choices, (gpointer)label); |
265 pref->choices = g_list_append(pref->choices, g_strdup(label)); |
| 257 pref->choices = g_list_append(pref->choices, choice); |
266 pref->choices = g_list_append(pref->choices, choice); |
| 258 } |
267 } |
| 259 |
268 |
| 260 GList * |
269 GList * |
| 261 purple_plugin_pref_get_choices(PurplePluginPref *pref) |
270 purple_plugin_pref_get_choices(PurplePluginPref *pref) |