| 523 static GdkPixbuf * |
523 static GdkPixbuf * |
| 524 pidgin_create_prpl_icon_from_prpl(PurplePlugin *prpl, PidginPrplIconSize size, PurpleAccount *account) |
524 pidgin_create_prpl_icon_from_prpl(PurplePlugin *prpl, PidginPrplIconSize size, PurpleAccount *account) |
| 525 { |
525 { |
| 526 PurplePluginProtocolInfo *prpl_info; |
526 PurplePluginProtocolInfo *prpl_info; |
| 527 const char *protoname = NULL; |
527 const char *protoname = NULL; |
| 528 char buf[MAXPATHLEN]; |
528 char *tmp; |
| 529 char *filename = NULL; |
529 char *filename = NULL; |
| 530 GdkPixbuf *pixbuf; |
530 GdkPixbuf *pixbuf; |
| 531 |
531 |
| 532 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
532 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
| 533 if (prpl_info->list_icon == NULL) |
533 if (prpl_info->list_icon == NULL) |
| 539 |
539 |
| 540 /* |
540 /* |
| 541 * Status icons will be themeable too, and then it will look up |
541 * Status icons will be themeable too, and then it will look up |
| 542 * protoname from the theme |
542 * protoname from the theme |
| 543 */ |
543 */ |
| 544 g_snprintf(buf, sizeof(buf), "%s.png", protoname); |
544 tmp = g_strconcat(protoname, ".png", NULL); |
| 545 |
545 |
| 546 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", |
546 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", |
| 547 size == PIDGIN_PRPL_ICON_SMALL ? "16" : |
547 size == PIDGIN_PRPL_ICON_SMALL ? "16" : |
| 548 size == PIDGIN_PRPL_ICON_MEDIUM ? "22" : "48", |
548 size == PIDGIN_PRPL_ICON_MEDIUM ? "22" : "48", |
| 549 buf, NULL); |
549 tmp, NULL); |
| |
550 g_free(tmp); |
| |
551 |
| 550 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
552 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
| 551 g_free(filename); |
553 g_free(filename); |
| 552 |
554 |
| 553 return pixbuf; |
555 return pixbuf; |
| 554 } |
556 } |