comparison src/themes.c @ 4298:cddb50734169

[gaim-migrate @ 4552] faceprint cleans up after my messes committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 11 Jan 2003 19:59:27 +0000
parents a723d060620a
children a23ae74677a2
comparison
equal deleted inserted replaced
4297:650454171e0e 4298:cddb50734169
21 21
22 #include "gaim.h" 22 #include "gaim.h"
23 #include "ui.h" 23 #include "ui.h"
24 #include "gtkimhtml.h" 24 #include "gtkimhtml.h"
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <string.h>
27 #include <ctype.h>
28 #include "gaim.h"
26 29
27 struct smiley_list { 30 struct smiley_list {
28 char *sml; 31 char *sml;
29 GSList *smileys; 32 GSList *smileys;
30 struct smiley_list *next; 33 struct smiley_list *next;
50 } 53 }
51 list = list->next; 54 list = list->next;
52 } 55 }
53 } 56 }
54 57
55 struct smiley_theme *load_smiley_theme(char *file, gboolean load) 58 struct smiley_theme *load_smiley_theme(const char *file, gboolean load)
56 { 59 {
57 FILE *f = fopen(file, "r"); 60 FILE *f = fopen(file, "r");
58 char buf[256]; 61 char buf[256];
59 char sml[16];
60 char *i; 62 char *i;
61 struct smiley_theme *theme=NULL; 63 struct smiley_theme *theme=NULL;
62 struct smiley_list *list = NULL; 64 struct smiley_list *list = NULL;
63 GSList *lst = smiley_themes; 65 GSList *lst = smiley_themes;
64 char *dirname; 66 char *dirname;
82 if (load) { 84 if (load) {
83 if (current_smiley_theme) { 85 if (current_smiley_theme) {
84 GSList *already_freed = NULL; 86 GSList *already_freed = NULL;
85 struct smiley_list *wer = current_smiley_theme->list; 87 struct smiley_list *wer = current_smiley_theme->list;
86 while (wer) { 88 while (wer) {
87 char *nds = !strcmp(wer->sml, "default") ? NULL : wer->sml;
88 GSList *already_freed = NULL; 89 GSList *already_freed = NULL;
89 while (wer->smileys) { 90 while (wer->smileys) {
90 GtkIMHtmlSmiley *uio = wer->smileys->data; 91 GtkIMHtmlSmiley *uio = wer->smileys->data;
91 if (uio->icon) 92 if (uio->icon)
92 g_object_unref(uio->icon); 93 g_object_unref(uio->icon);
203 204
204 /* Here we check to see that the theme has proper syntax. 205 /* Here we check to see that the theme has proper syntax.
205 * We set the second argument to FALSE so that it doesn't load 206 * We set the second argument to FALSE so that it doesn't load
206 * the theme yet. 207 * the theme yet.
207 */ 208 */
208 if (smile = load_smiley_theme(path, FALSE)) { 209 if ((smile = load_smiley_theme(path, FALSE))) {
209 smiley_themes = g_slist_append(smiley_themes, smile); 210 smiley_themes = g_slist_append(smiley_themes, smile);
210 } 211 }
211 g_free(path); 212 g_free(path);
212 } 213 }
213 g_dir_close(dir); 214 g_dir_close(dir);