diff src/search.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 6a7298988a7a
children 767b53cd9ab7
line wrap: on
line diff
--- a/src/search.c	Fri Apr 11 20:35:37 2008 +0000
+++ b/src/search.c	Fri Apr 11 22:14:36 2008 +0000
@@ -779,7 +779,7 @@
 
 	sd->thumb_fd = mfd->fd;
 	thumb_loader_free(sd->thumb_loader);
-	sd->thumb_loader = thumb_loader_new(thumb_max_width, thumb_max_height);
+	sd->thumb_loader = thumb_loader_new(options->thumb_max_width, options->thumb_max_height);
 
 	thumb_loader_set_callbacks(sd->thumb_loader,
 				   search_result_thumb_done_cb,
@@ -802,14 +802,14 @@
 	column = gtk_tree_view_get_column(GTK_TREE_VIEW(sd->result_view), SEARCH_COLUMN_THUMB - 1);
 	if (!column) return;
 
-	gtk_tree_view_column_set_fixed_width(column, (sd->thumb_enable) ? thumb_max_width : 4);
+	gtk_tree_view_column_set_fixed_width(column, (sd->thumb_enable) ? options->thumb_max_width : 4);
 
 	list = gtk_tree_view_column_get_cell_renderers(column);
 	if (!list) return;
 	cell = list->data;
 	g_list_free(list);
 
-	g_object_set(G_OBJECT(cell), "height", (sd->thumb_enable) ? thumb_max_height : -1, NULL);
+	g_object_set(G_OBJECT(cell), "height", (sd->thumb_enable) ? options->thumb_max_height : -1, NULL);
 	gtk_tree_view_columns_autosize(GTK_TREE_VIEW(sd->result_view));
 }
 
@@ -1500,7 +1500,7 @@
 			image_sim_free(sim);
 			}
 
-		if (enable_thumb_caching &&
+		if (options->enable_thumb_caching &&
 		    sd->img_loader && sd->img_loader->fd)
 			{
 			gchar *base;