comparison 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
comparison
equal deleted inserted replaced
317:46169c246c51 318:b16b9b8979e5
777 777
778 search_progress_update(sd, FALSE, (gdouble)row/length); 778 search_progress_update(sd, FALSE, (gdouble)row/length);
779 779
780 sd->thumb_fd = mfd->fd; 780 sd->thumb_fd = mfd->fd;
781 thumb_loader_free(sd->thumb_loader); 781 thumb_loader_free(sd->thumb_loader);
782 sd->thumb_loader = thumb_loader_new(thumb_max_width, thumb_max_height); 782 sd->thumb_loader = thumb_loader_new(options->thumb_max_width, options->thumb_max_height);
783 783
784 thumb_loader_set_callbacks(sd->thumb_loader, 784 thumb_loader_set_callbacks(sd->thumb_loader,
785 search_result_thumb_done_cb, 785 search_result_thumb_done_cb,
786 search_result_thumb_done_cb, 786 search_result_thumb_done_cb,
787 NULL, 787 NULL,
800 GList *list; 800 GList *list;
801 801
802 column = gtk_tree_view_get_column(GTK_TREE_VIEW(sd->result_view), SEARCH_COLUMN_THUMB - 1); 802 column = gtk_tree_view_get_column(GTK_TREE_VIEW(sd->result_view), SEARCH_COLUMN_THUMB - 1);
803 if (!column) return; 803 if (!column) return;
804 804
805 gtk_tree_view_column_set_fixed_width(column, (sd->thumb_enable) ? thumb_max_width : 4); 805 gtk_tree_view_column_set_fixed_width(column, (sd->thumb_enable) ? options->thumb_max_width : 4);
806 806
807 list = gtk_tree_view_column_get_cell_renderers(column); 807 list = gtk_tree_view_column_get_cell_renderers(column);
808 if (!list) return; 808 if (!list) return;
809 cell = list->data; 809 cell = list->data;
810 g_list_free(list); 810 g_list_free(list);
811 811
812 g_object_set(G_OBJECT(cell), "height", (sd->thumb_enable) ? thumb_max_height : -1, NULL); 812 g_object_set(G_OBJECT(cell), "height", (sd->thumb_enable) ? options->thumb_max_height : -1, NULL);
813 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(sd->result_view)); 813 gtk_tree_view_columns_autosize(GTK_TREE_VIEW(sd->result_view));
814 } 814 }
815 815
816 static void search_result_thumb_enable(SearchData *sd, gint enable) 816 static void search_result_thumb_enable(SearchData *sd, gint enable)
817 { 817 {
1498 sim = image_sim_new_from_pixbuf(pixbuf); 1498 sim = image_sim_new_from_pixbuf(pixbuf);
1499 cache_sim_data_set_similarity(cd, sim); 1499 cache_sim_data_set_similarity(cd, sim);
1500 image_sim_free(sim); 1500 image_sim_free(sim);
1501 } 1501 }
1502 1502
1503 if (enable_thumb_caching && 1503 if (options->enable_thumb_caching &&
1504 sd->img_loader && sd->img_loader->fd) 1504 sd->img_loader && sd->img_loader->fd)
1505 { 1505 {
1506 gchar *base; 1506 gchar *base;
1507 const gchar *path; 1507 const gchar *path;
1508 mode_t mode = 0755; 1508 mode_t mode = 0755;