diff src/view_file_icon.c @ 318:b16b9b8979e5

Add a new struct ConfOptions to handle options. Changes were made among the code to use only one global var named "options" of type ConfOptions *. Initialization takes place in new init_options().
author zas_
date Fri, 11 Apr 2008 22:14:36 +0000
parents 9995c5fb202a
children c74af1cbd61a
line wrap: on
line diff
--- a/src/view_file_icon.c	Fri Apr 11 20:35:37 2008 +0000
+++ b/src/view_file_icon.c	Fri Apr 11 22:14:36 2008 +0000
@@ -380,7 +380,7 @@
 	cur_fd = layout_image_get_fd(vfi->layout);
 	if (sel_fd == cur_fd) return; /* no change */
 	
-	if (enable_read_ahead)
+	if (options->enable_read_ahead)
 		{
 		gint row;
 
@@ -411,11 +411,11 @@
 {
 	gint width;
 
-	if (!vfi->show_text) return thumb_max_width;
-
-	width = thumb_max_width + thumb_max_width / 2;
+	if (!vfi->show_text) return options->thumb_max_width;
+
+	width = options->thumb_max_width + options->thumb_max_width / 2;
 	if (width < THUMB_MIN_ICON_WIDTH) width = THUMB_MIN_ICON_WIDTH;
-	if (width > THUMB_MAX_ICON_WIDTH) width = thumb_max_width;
+	if (width > THUMB_MAX_ICON_WIDTH) width = options->thumb_max_width;
 
 	return width;
 }
@@ -860,7 +860,7 @@
 
 	vfi->prev_selection = end;
 
-	if (!collection_rectangular_selection)
+	if (!options->collection_rectangular_selection)
 		{
 		GList *work;
 		IconData *id;
@@ -1256,8 +1256,8 @@
 	adj = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(vfi->listview));
 	page_size = (gint)adj->page_increment;
 
-	row_height = thumb_max_height + THUMB_BORDER_PADDING * 2;
-	if (vfi->show_text) row_height += thumb_max_height / 3;
+	row_height = options->thumb_max_height + THUMB_BORDER_PADDING * 2;
+	if (vfi->show_text) row_height += options->thumb_max_height / 3;
 
 	ret = page_size / row_height;
 	if (ret < 1) ret = 1;
@@ -1382,7 +1382,7 @@
 			{
 			if (event->state & GDK_SHIFT_MASK)
 				{
-				if (!collection_rectangular_selection)
+				if (!options->collection_rectangular_selection)
 					{
 					vficon_select_region_util(vfi, old_id, new_id, FALSE);
 					}
@@ -1664,7 +1664,7 @@
 			if (cell && GQV_IS_CELL_RENDERER_ICON(cell))
 				{
 				g_object_set(G_OBJECT(cell), "fixed_width", thumb_width,
-							     "fixed_height", thumb_max_height,
+							     "fixed_height", options->thumb_max_height,
 							     "show_text", vfi->show_text, NULL);
 				}
 			}
@@ -1990,7 +1990,7 @@
 
 	thumb_loader_free(vfi->thumbs_loader);
 
-	vfi->thumbs_loader = thumb_loader_new(thumb_max_width, thumb_max_height);
+	vfi->thumbs_loader = thumb_loader_new(options->thumb_max_width, options->thumb_max_height);
 	thumb_loader_set_callbacks(vfi->thumbs_loader,
 				   vficon_thumb_done_cb,
 				   vficon_thumb_error_cb,