| 241 break; |
240 break; |
| 242 } |
241 } |
| 243 lst = lst->next; |
242 lst = lst->next; |
| 244 } |
243 } |
| 245 |
244 |
| 246 if (!theme) { |
245 if (theme == current_smiley_theme) { |
| 247 new_theme = TRUE; |
|
| 248 theme = g_new0(struct smiley_theme, 1); |
|
| 249 theme->path = g_strdup(file); |
|
| 250 } else if (theme == current_smiley_theme) { |
|
| 251 /* Don't reload the theme if it is already loaded */ |
246 /* Don't reload the theme if it is already loaded */ |
| 252 fclose(f); |
247 fclose(f); |
| 253 return; |
248 return; |
| |
249 } |
| |
250 |
| |
251 if (theme == NULL) { |
| |
252 theme = g_new0(struct smiley_theme, 1); |
| |
253 theme->path = g_strdup(file); |
| |
254 smiley_themes = g_slist_prepend(smiley_themes, theme); |
| 254 } |
255 } |
| 255 |
256 |
| 256 dirname = g_path_get_dirname(file); |
257 dirname = g_path_get_dirname(file); |
| 257 |
258 |
| 258 while (!feof(f)) { |
259 while (!feof(f)) { |
| 339 fclose(f); |
340 fclose(f); |
| 340 |
341 |
| 341 if (!theme->name || !theme->desc || !theme->author) { |
342 if (!theme->name || !theme->desc || !theme->author) { |
| 342 purple_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file); |
343 purple_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file); |
| 343 |
344 |
| |
345 smiley_themes = g_slist_remove(smiley_themes, theme); |
| 344 pidgin_themes_destroy_smiley_theme(theme); |
346 pidgin_themes_destroy_smiley_theme(theme); |
| 345 return; |
347 return; |
| 346 } |
|
| 347 |
|
| 348 if (new_theme) { |
|
| 349 smiley_themes = g_slist_prepend(smiley_themes, theme); |
|
| 350 } |
348 } |
| 351 |
349 |
| 352 if (load) { |
350 if (load) { |
| 353 GList *cnv; |
351 GList *cnv; |
| 354 |
352 |