Code cleanup

This commit is contained in:
Pierre Pronchery 2012-12-05 15:45:48 +01:00
parent 74bbe5afcb
commit 4c29e9075d

View File

@ -396,6 +396,7 @@ static void _refresh_type(Properties * properties, struct stat * st)
GtkWidget * image = NULL; GtkWidget * image = NULL;
char * p; char * p;
struct stat dirst; struct stat dirst;
const int iconsize = 48;
int flags = GTK_ICON_LOOKUP_FORCE_SIZE; int flags = GTK_ICON_LOOKUP_FORCE_SIZE;
if(S_ISDIR(st->st_mode)) if(S_ISDIR(st->st_mode))
@ -432,10 +433,11 @@ static void _refresh_type(Properties * properties, struct stat * st)
free(p); free(p);
if(icon != NULL) if(icon != NULL)
pixbuf = gtk_icon_theme_load_icon(properties->theme, pixbuf = gtk_icon_theme_load_icon(properties->theme,
icon, 48, flags, NULL); icon, iconsize, flags, NULL);
if(pixbuf == NULL) if(pixbuf == NULL)
pixbuf = gtk_icon_theme_load_icon(properties->theme, pixbuf = gtk_icon_theme_load_icon(properties->theme,
"gnome-fs-directory", 48, flags, NULL); "gnome-fs-directory", iconsize, flags,
NULL);
if(pixbuf != NULL) if(pixbuf != NULL)
image = gtk_image_new_from_pixbuf(pixbuf); image = gtk_image_new_from_pixbuf(pixbuf);
if(image == NULL) if(image == NULL)
@ -461,13 +463,13 @@ static void _refresh_type(Properties * properties, struct stat * st)
type = "application/x-executable"; type = "application/x-executable";
if(type != NULL && pixbuf == NULL if(type != NULL && pixbuf == NULL
&& (pixbuf = helper->get_icon(helper->browser, && (pixbuf = helper->get_icon(helper->browser,
type, st, 48)) != NULL) type, st, iconsize)) != NULL)
image = gtk_image_new_from_pixbuf(pixbuf); image = gtk_image_new_from_pixbuf(pixbuf);
if(type == NULL) if(type == NULL)
type = _("Unknown type"); type = _("Unknown type");
if(image == NULL && (pixbuf = gtk_icon_theme_load_icon( if(image == NULL && (pixbuf = gtk_icon_theme_load_icon(
properties->theme, "gnome-fs-regular", properties->theme, "gnome-fs-regular",
48, flags, NULL)) != NULL) iconsize, flags, NULL)) != NULL)
image = gtk_image_new_from_pixbuf(pixbuf); image = gtk_image_new_from_pixbuf(pixbuf);
if(image == NULL) if(image == NULL)
image = gtk_image_new_from_stock(GTK_STOCK_FILE, image = gtk_image_new_from_stock(GTK_STOCK_FILE,