static GdkPixbuf *get_icon(TrgRssCellRenderer * r, GtkIconSize icon_size, GtkWidget * for_widget) { const char *mime_type = "file"; return gtr_get_mime_type_icon(mime_type, icon_size, for_widget); }
static GdkPixbuf* get_icon( const tr_torrent * tor, GtkIconSize icon_size, GtkWidget * for_widget ) { const char * mime_type; const tr_info * info = tr_torrentInfo( tor ); if( info->fileCount == 0 ) mime_type = UNKNOWN_MIME_TYPE; else if( info->fileCount > 1 ) mime_type = DIRECTORY_MIME_TYPE; else if( strchr( info->files[0].name, '/' ) != NULL ) mime_type = DIRECTORY_MIME_TYPE; else mime_type = gtr_get_mime_type_from_filename( info->files[0].name ); return gtr_get_mime_type_icon( mime_type, icon_size, for_widget ); }