pidgin/gtkthemes.c

branch
custom_smiley
changeset 22655
718f1149a81c
parent 22443
7b8772af6bb7
child 24588
b2c89babe134
equal deleted inserted replaced
22654:88039f87f479 22655:718f1149a81c
133 GSList *icons = list->smileys; 133 GSList *icons = list->smileys;
134 while (icons) { 134 while (icons) {
135 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), sml, icons->data); 135 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), sml, icons->data);
136 icons = icons->next; 136 icons = icons->next;
137 } 137 }
138 138
139 if (custom == TRUE) { 139 if (custom == TRUE) {
140 icons = pidgin_smileys_get_all(); 140 icons = pidgin_smileys_get_all();
141 141
142 while (icons) { 142 while (icons) {
143 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), sml, icons->data); 143 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), sml, icons->data);
293 theme->author = g_strdup(i + strlen("Author=")); 293 theme->author = g_strdup(i + strlen("Author="));
294 theme->author[strlen(theme->author)-1] = 0; 294 theme->author[strlen(theme->author)-1] = 0;
295 } else if (load && list) { 295 } else if (load && list) {
296 gboolean hidden = FALSE; 296 gboolean hidden = FALSE;
297 char *sfile = NULL; 297 char *sfile = NULL;
298 gboolean have_used_sfile = FALSE;
299 298
300 if (*i == '!' && *(i + 1) == ' ') { 299 if (*i == '!' && *(i + 1) == ' ') {
301 hidden = TRUE; 300 hidden = TRUE;
302 i = i + 2; 301 i = i + 2;
303 } 302 }
307 while (!isspace(*i) && li < sizeof(l) - 1) { 306 while (!isspace(*i) && li < sizeof(l) - 1) {
308 if (*i == '\\' && *(i+1) != '\0' && *(i+1) != '\n' && *(i+1) != '\r') 307 if (*i == '\\' && *(i+1) != '\0' && *(i+1) != '\n' && *(i+1) != '\r')
309 i++; 308 i++;
310 l[li++] = *(i++); 309 l[li++] = *(i++);
311 } 310 }
311 l[li] = 0;
312 if (!sfile) { 312 if (!sfile) {
313 l[li] = 0;
314 sfile = g_build_filename(dirname, l, NULL); 313 sfile = g_build_filename(dirname, l, NULL);
315 } else { 314 } else {
316 GtkIMHtmlSmiley *smiley = g_new0(GtkIMHtmlSmiley, 1); 315 GtkIMHtmlSmiley *smiley = gtk_imhtml_smiley_create(sfile, l, hidden, 0);
317 l[li] = 0;
318 smiley->file = sfile;
319 smiley->smile = g_strdup(l);
320 smiley->hidden = hidden;
321 list->smileys = g_slist_prepend(list->smileys, smiley); 316 list->smileys = g_slist_prepend(list->smileys, smiley);
322 have_used_sfile = TRUE;
323 } 317 }
324 while (isspace(*i)) 318 while (isspace(*i))
325 i++; 319 i++;
326 320
327 } 321 }
328 322
329 323
330 if (!have_used_sfile) 324 g_free(sfile);
331 g_free(sfile);
332 } 325 }
333 } 326 }
334 327
335 /* Reverse the Smiley list since it was built in reverse order for efficiency reasons */ 328 /* Reverse the Smiley list since it was built in reverse order for efficiency reasons */
336 if (list != NULL) 329 if (list != NULL)

mercurial