diff src/layout.c @ 1356:681e79dd0820

Slightly modify access_file() and use it to test profile files existence and read access.
author zas_
date Sun, 01 Mar 2009 15:41:51 +0000
parents 06ec1279e33e
children b3156b2ec4c5
line wrap: on
line diff
--- a/src/layout.c	Sun Mar 01 15:28:06 2009 +0000
+++ b/src/layout.c	Sun Mar 01 15:41:51 2009 +0000
@@ -482,7 +482,7 @@
 					   G_CALLBACK(layout_color_menu_input_cb), lw);
 		g_free(buf);
 		g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(i + COLOR_PROFILE_FILE));
-		gtk_widget_set_sensitive(item, active && !from_image && file && file[0] && access_file(file, R_OK));
+		gtk_widget_set_sensitive(item, active && !from_image && access_file(file, R_OK));
 		}
 
 	menu_item_add_divider(menu);
@@ -498,7 +498,7 @@
 				   _("_Screen profile"), (screen == 1),
 				   G_CALLBACK(layout_color_menu_screen_cb), lw);
 	g_object_set_data(G_OBJECT(item), COLOR_MENU_KEY, GINT_TO_POINTER(1));
-	gtk_widget_set_sensitive(item, active && options->color_profile.screen_file && options->color_profile.screen_file[0]);
+	gtk_widget_set_sensitive(item, active && access_file(options->color_profile.screen_file, R_OK));
 
 	gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME);
 #endif /* HAVE_LCMS */