| 124 |
124 |
| 125 return pref; |
125 return pref; |
| 126 } |
126 } |
| 127 |
127 |
| 128 GaimPluginPref * |
128 GaimPluginPref * |
| 129 gaim_plugin_pref_new_with_name_and_label(char *name, char *label) { |
129 gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label) { |
| 130 GaimPluginPref *pref; |
130 GaimPluginPref *pref; |
| 131 |
131 |
| 132 g_return_val_if_fail(name, NULL); |
132 g_return_val_if_fail(name, NULL); |
| 133 g_return_val_if_fail(label, NULL); |
133 g_return_val_if_fail(label, NULL); |
| 134 |
134 |
| 160 |
160 |
| 161 g_free(pref); |
161 g_free(pref); |
| 162 } |
162 } |
| 163 |
163 |
| 164 void |
164 void |
| 165 gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name) { |
165 gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name) { |
| 166 g_return_if_fail(pref); |
166 g_return_if_fail(pref); |
| 167 g_return_if_fail(name); |
167 g_return_if_fail(name); |
| 168 |
168 |
| 169 if(pref->name) |
169 if(pref->name) |
| 170 g_free(pref->name); |
170 g_free(pref->name); |
| 171 |
171 |
| 172 pref->name = g_strdup(name); |
172 pref->name = g_strdup(name); |
| 173 } |
173 } |
| 174 |
174 |
| 175 char * |
175 const char * |
| 176 gaim_plugin_pref_get_name(GaimPluginPref *pref) { |
176 gaim_plugin_pref_get_name(GaimPluginPref *pref) { |
| 177 g_return_val_if_fail(pref, NULL); |
177 g_return_val_if_fail(pref, NULL); |
| 178 |
178 |
| 179 return pref->name; |
179 return pref->name; |
| 180 } |
180 } |
| 181 |
181 |
| 182 void |
182 void |
| 183 gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label) { |
183 gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label) { |
| 184 g_return_if_fail(pref); |
184 g_return_if_fail(pref); |
| 185 g_return_if_fail(label); |
185 g_return_if_fail(label); |
| 186 |
186 |
| 187 if(pref->label) |
187 if(pref->label) |
| 188 g_free(pref->label); |
188 g_free(pref->label); |
| 189 |
189 |
| 190 pref->label = g_strdup(label); |
190 pref->label = g_strdup(label); |
| 191 } |
191 } |
| 192 |
192 |
| 193 char * |
193 const char * |
| 194 gaim_plugin_pref_get_label(GaimPluginPref *pref) { |
194 gaim_plugin_pref_get_label(GaimPluginPref *pref) { |
| 195 g_return_val_if_fail(pref, NULL); |
195 g_return_val_if_fail(pref, NULL); |
| 196 |
196 |
| 197 return pref->label; |
197 return pref->label; |
| 198 } |
198 } |
| 249 |
249 |
| 250 return pref->type; |
250 return pref->type; |
| 251 } |
251 } |
| 252 |
252 |
| 253 void |
253 void |
| 254 gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice) { |
254 gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice) { |
| 255 g_return_if_fail(pref); |
255 g_return_if_fail(pref); |
| 256 g_return_if_fail(label); |
256 g_return_if_fail(label); |
| 257 g_return_if_fail(choice); |
257 g_return_if_fail(choice); |
| 258 |
258 |
| 259 pref->choices = g_list_append(pref->choices, label); |
259 pref->choices = g_list_append(pref->choices, (gpointer)label); |
| 260 pref->choices = g_list_append(pref->choices, choice); |
260 pref->choices = g_list_append(pref->choices, choice); |
| 261 } |
261 } |
| 262 |
262 |
| 263 GList * |
263 GList * |
| 264 gaim_plugin_pref_get_choices(GaimPluginPref *pref) { |
264 gaim_plugin_pref_get_choices(GaimPluginPref *pref) { |