diff options
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r-- | src/plugins/fs/search.c | 345 |
1 files changed, 167 insertions, 178 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index b92b50a3..d924b26b 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -98,93 +98,93 @@ updateSearchSummary (SearchList * searchContext) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | static GdkPixbuf * | 100 | static GdkPixbuf * |
101 | make_ranking_pixbuf(int availability_rank, | 101 | make_ranking_pixbuf (int availability_rank, |
102 | unsigned int availability_certainty, | 102 | unsigned int availability_certainty, |
103 | unsigned int applicability_rank, | 103 | unsigned int applicability_rank, unsigned int kwords) |
104 | unsigned int kwords) | ||
105 | { | 104 | { |
106 | GdkPixbuf *pixbuf; | 105 | GdkPixbuf *pixbuf; |
107 | guchar * pixels; | 106 | guchar *pixels; |
108 | guchar * pixel; | 107 | guchar *pixel; |
109 | int n_channels; | 108 | int n_channels; |
110 | int rowstride; | 109 | int rowstride; |
111 | unsigned int x; | 110 | unsigned int x; |
112 | unsigned int y; | 111 | unsigned int y; |
113 | 112 | ||
114 | #define P_HEIGHT 21 | 113 | #define P_HEIGHT 21 |
115 | #define P_WIDTH 60 | 114 | #define P_WIDTH 60 |
116 | pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, | 115 | pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, /* alpha */ |
117 | TRUE, /* alpha */ | 116 | 8, /* bits per sample */ |
118 | 8, /* bits per sample */ | 117 | P_WIDTH, /* width */ |
119 | P_WIDTH, /* width */ | 118 | P_HEIGHT /* height */ |
120 | P_HEIGHT /* height */ | 119 | ); |
121 | ); | ||
122 | n_channels = gdk_pixbuf_get_n_channels (pixbuf); | 120 | n_channels = gdk_pixbuf_get_n_channels (pixbuf); |
123 | pixels = gdk_pixbuf_get_pixels(pixbuf); | 121 | pixels = gdk_pixbuf_get_pixels (pixbuf); |
124 | rowstride = gdk_pixbuf_get_rowstride(pixbuf); | 122 | rowstride = gdk_pixbuf_get_rowstride (pixbuf); |
125 | for (x=0;x<P_WIDTH;x++) | 123 | for (x = 0; x < P_WIDTH; x++) |
126 | for (y=0;y<P_HEIGHT;y++) | 124 | for (y = 0; y < P_HEIGHT; y++) |
127 | { | 125 | { |
128 | pixel = pixels + y * rowstride + x * n_channels; | 126 | pixel = pixels + y * rowstride + x * n_channels; |
129 | #define PX_RED 0 | 127 | #define PX_RED 0 |
130 | #define PX_GREEN 1 | 128 | #define PX_GREEN 1 |
131 | #define PX_BLUE 2 | 129 | #define PX_BLUE 2 |
132 | #define PX_ALPHA 3 | 130 | #define PX_ALPHA 3 |
133 | pixel[PX_RED] = 0; | 131 | pixel[PX_RED] = 0; |
134 | pixel[PX_GREEN] = 0; | 132 | pixel[PX_GREEN] = 0; |
135 | pixel[PX_BLUE] = 0; | 133 | pixel[PX_BLUE] = 0; |
136 | pixel[PX_ALPHA] = 0; | 134 | pixel[PX_ALPHA] = 0; |
137 | if (y < P_HEIGHT / 2) | 135 | if (y < P_HEIGHT / 2) |
138 | { | 136 | { |
139 | /* applicability */ | 137 | /* applicability */ |
140 | if (x * kwords < applicability_rank * P_WIDTH) | 138 | if (x * kwords < applicability_rank * P_WIDTH) |
141 | { | 139 | { |
142 | pixel[PX_RED] = 0; | 140 | pixel[PX_RED] = 0; |
143 | pixel[PX_GREEN] = 0; | 141 | pixel[PX_GREEN] = 0; |
144 | pixel[PX_BLUE] = 255; | 142 | pixel[PX_BLUE] = 255; |
145 | pixel[PX_ALPHA] = 255; | 143 | pixel[PX_ALPHA] = 255; |
146 | } | 144 | } |
147 | } | 145 | } |
148 | else if ( (y > P_HEIGHT / 2) && | 146 | else if ((y > P_HEIGHT / 2) && |
149 | ( (y-P_HEIGHT/2) * GNUNET_FSUI_MAX_PROBES | 147 | ((y - P_HEIGHT / 2) * GNUNET_FSUI_MAX_PROBES |
150 | < availability_certainty * P_HEIGHT / 2) ) | 148 | < availability_certainty * P_HEIGHT / 2)) |
151 | { | 149 | { |
152 | /* availability */ | 150 | /* availability */ |
153 | if (availability_rank < 0) | 151 | if (availability_rank < 0) |
154 | { | 152 | { |
155 | if ( (x * GNUNET_FSUI_MAX_PROBES > (GNUNET_FSUI_MAX_PROBES+availability_rank) * P_WIDTH/2) && | 153 | if ((x * GNUNET_FSUI_MAX_PROBES > |
156 | (x <= P_WIDTH/2) ) | 154 | (GNUNET_FSUI_MAX_PROBES + |
157 | { | 155 | availability_rank) * P_WIDTH / 2) && (x <= P_WIDTH / 2)) |
158 | pixel[PX_RED] = 255; | 156 | { |
159 | pixel[PX_GREEN] = 0; | 157 | pixel[PX_RED] = 255; |
160 | pixel[PX_BLUE] = 0; | 158 | pixel[PX_GREEN] = 0; |
161 | pixel[PX_ALPHA] = 255; | 159 | pixel[PX_BLUE] = 0; |
162 | } | 160 | pixel[PX_ALPHA] = 255; |
163 | } | 161 | } |
164 | else if (availability_rank > 0) | 162 | } |
165 | { | 163 | else if (availability_rank > 0) |
166 | if ( (x >= P_WIDTH/2) && | 164 | { |
167 | ( (x - (P_WIDTH/2)) * GNUNET_FSUI_MAX_PROBES < availability_rank * P_WIDTH/2) ) | 165 | if ((x >= P_WIDTH / 2) && |
168 | { | 166 | ((x - (P_WIDTH / 2)) * GNUNET_FSUI_MAX_PROBES < |
169 | pixel[PX_RED] = 0; | 167 | availability_rank * P_WIDTH / 2)) |
170 | pixel[PX_GREEN] = 255; | 168 | { |
171 | pixel[PX_BLUE] = 0; | 169 | pixel[PX_RED] = 0; |
172 | pixel[PX_ALPHA] = 255; | 170 | pixel[PX_GREEN] = 255; |
173 | } | 171 | pixel[PX_BLUE] = 0; |
174 | } | 172 | pixel[PX_ALPHA] = 255; |
175 | else | 173 | } |
176 | { | 174 | } |
177 | if (x == P_WIDTH / 2) | 175 | else |
178 | { | 176 | { |
179 | /* yellow */ | 177 | if (x == P_WIDTH / 2) |
180 | pixel[PX_RED] = 255; | 178 | { |
181 | pixel[PX_GREEN] = 255; | 179 | /* yellow */ |
182 | pixel[PX_BLUE] = 0; | 180 | pixel[PX_RED] = 255; |
183 | pixel[PX_ALPHA] = 255; | 181 | pixel[PX_GREEN] = 255; |
184 | } | 182 | pixel[PX_BLUE] = 0; |
185 | } | 183 | pixel[PX_ALPHA] = 255; |
186 | } | 184 | } |
187 | } | 185 | } |
186 | } | ||
187 | } | ||
188 | return pixbuf; | 188 | return pixbuf; |
189 | } | 189 | } |
190 | 190 | ||
@@ -211,34 +211,26 @@ addEntryToSearchTree (SearchList * searchContext, | |||
211 | desc = getDescriptionFromMetaData (info->meta); | 211 | desc = getDescriptionFromMetaData (info->meta); |
212 | name = getFileNameFromMetaData (info->meta); | 212 | name = getFileNameFromMetaData (info->meta); |
213 | size = GNUNET_ECRS_uri_test_chk (info->uri) | 213 | size = GNUNET_ECRS_uri_test_chk (info->uri) |
214 | || GNUNET_ECRS_uri_test_loc (info-> | 214 | || GNUNET_ECRS_uri_test_loc (info->uri) ? |
215 | uri) ? GNUNET_ECRS_uri_get_file_size (info-> | 215 | GNUNET_ECRS_uri_get_file_size (info->uri) : 0; |
216 | uri) : | ||
217 | 0; | ||
218 | pixbuf = getThumbnailFromMetaData (info->meta); | 216 | pixbuf = getThumbnailFromMetaData (info->meta); |
219 | size_h = GNUNET_get_byte_size_as_fancy_string (size); | 217 | size_h = GNUNET_get_byte_size_as_fancy_string (size); |
220 | rankbuf = make_ranking_pixbuf(0, 0, 1, | 218 | rankbuf = make_ranking_pixbuf (0, 0, 1, |
221 | GNUNET_ECRS_uri_get_keyword_count_from_ksk(searchContext->uri)); | 219 | GNUNET_ECRS_uri_get_keyword_count_from_ksk |
222 | gtk_tree_store_set (searchContext->tree, | 220 | (searchContext->uri)); |
223 | iter, | 221 | gtk_tree_store_set (searchContext->tree, iter, SEARCH_NAME, name, |
224 | SEARCH_NAME, name, | 222 | SEARCH_SIZE, size, SEARCH_HSIZE, size_h, SEARCH_MIME, |
225 | SEARCH_SIZE, size, | 223 | mime, SEARCH_DESC, desc, SEARCH_PIXBUF, pixbuf, |
226 | SEARCH_HSIZE, size_h, | ||
227 | SEARCH_MIME, mime, | ||
228 | SEARCH_DESC, desc, | ||
229 | SEARCH_PIXBUF, pixbuf, | ||
230 | SEARCH_URI, GNUNET_ECRS_uri_duplicate (info->uri), | 224 | SEARCH_URI, GNUNET_ECRS_uri_duplicate (info->uri), |
231 | SEARCH_META, GNUNET_ECRS_meta_data_duplicate (info->meta), | 225 | SEARCH_META, |
226 | GNUNET_ECRS_meta_data_duplicate (info->meta), | ||
232 | SEARCH_CELL_BG_COLOR, getColorCode (state), | 227 | SEARCH_CELL_BG_COLOR, getColorCode (state), |
233 | SEARCH_CELL_FG_COLOR, "black", | 228 | SEARCH_CELL_FG_COLOR, "black", SEARCH_INTERNAL, |
234 | SEARCH_INTERNAL, searchContext, | 229 | searchContext, SEARCH_INTERNAL_PARENT, downloadParent, |
235 | SEARCH_INTERNAL_PARENT, downloadParent, | 230 | SEARCH_STATUS, getStatusName (state), |
236 | SEARCH_STATUS, getStatusName (state), | 231 | SEARCH_APPLICABILITY_RANK, 1, SEARCH_RANK_SORT, |
237 | SEARCH_APPLICABILITY_RANK, 1, | 232 | (long long) 1, SEARCH_RANK_PIXBUF, rankbuf, -1); |
238 | SEARCH_RANK_SORT, (long long) 1, | 233 | g_object_unref (rankbuf); |
239 | SEARCH_RANK_PIXBUF, rankbuf, | ||
240 | -1); | ||
241 | g_object_unref(rankbuf); | ||
242 | if (pixbuf != NULL) | 234 | if (pixbuf != NULL) |
243 | g_object_unref (pixbuf); | 235 | g_object_unref (pixbuf); |
244 | GNUNET_free (size_h); | 236 | GNUNET_free (size_h); |
@@ -301,11 +293,12 @@ fs_search_result_received (SearchList * searchContext, | |||
301 | * @param availability_rank availability estimate | 293 | * @param availability_rank availability estimate |
302 | * @param applicability_rank relevance | 294 | * @param applicability_rank relevance |
303 | */ | 295 | */ |
304 | void fs_search_update (SearchList * searchContext, | 296 | void |
305 | const GNUNET_ECRS_FileInfo * info, | 297 | fs_search_update (SearchList * searchContext, |
306 | int availability_rank, | 298 | const GNUNET_ECRS_FileInfo * info, |
307 | unsigned int availability_certainty, | 299 | int availability_rank, |
308 | unsigned int applicability_rank) | 300 | unsigned int availability_certainty, |
301 | unsigned int applicability_rank) | ||
309 | { | 302 | { |
310 | GtkTreeStore *model; | 303 | GtkTreeStore *model; |
311 | GtkTreeIter iter; | 304 | GtkTreeIter iter; |
@@ -314,7 +307,7 @@ void fs_search_update (SearchList * searchContext, | |||
314 | long long rank; | 307 | long long rank; |
315 | unsigned int kwords; | 308 | unsigned int kwords; |
316 | 309 | ||
317 | kwords = GNUNET_ECRS_uri_get_keyword_count_from_ksk(searchContext->uri); | 310 | kwords = GNUNET_ECRS_uri_get_keyword_count_from_ksk (searchContext->uri); |
318 | model = GTK_TREE_STORE (gtk_tree_view_get_model (searchContext->treeview)); | 311 | model = GTK_TREE_STORE (gtk_tree_view_get_model (searchContext->treeview)); |
319 | /* find existing entry */ | 312 | /* find existing entry */ |
320 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) | 313 | if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) |
@@ -324,31 +317,33 @@ void fs_search_update (SearchList * searchContext, | |||
324 | have = NULL; | 317 | have = NULL; |
325 | gtk_tree_model_get (GTK_TREE_MODEL (model), | 318 | gtk_tree_model_get (GTK_TREE_MODEL (model), |
326 | &iter, SEARCH_URI, &have, -1); | 319 | &iter, SEARCH_URI, &have, -1); |
327 | if ( (have != NULL) && | 320 | if ((have != NULL) && |
328 | (GNUNET_ECRS_uri_test_equal (have, info->uri)) ) | 321 | (GNUNET_ECRS_uri_test_equal (have, info->uri))) |
329 | { | 322 | { |
330 | /* gotcha, create pixbuf and rank info! */ | 323 | /* gotcha, create pixbuf and rank info! */ |
331 | rank = (int) applicability_rank + (int) (availability_rank * (int) availability_certainty * 65536); | 324 | rank = |
332 | pixbuf = make_ranking_pixbuf(availability_rank, | 325 | (int) applicability_rank + |
333 | availability_certainty, | 326 | (int) (availability_rank * (int) availability_certainty * |
334 | applicability_rank, | 327 | 65536); |
335 | kwords); | 328 | pixbuf = |
336 | gtk_tree_store_set(searchContext->tree, | 329 | make_ranking_pixbuf (availability_rank, |
337 | &iter, | 330 | availability_certainty, |
338 | SEARCH_AVAILABILITY_RANK, availability_rank, | 331 | applicability_rank, kwords); |
339 | SEARCH_AVAILABILITY_CERTAINTY, availability_certainty, | 332 | gtk_tree_store_set (searchContext->tree, &iter, |
340 | SEARCH_APPLICABILITY_RANK, applicability_rank, | 333 | SEARCH_AVAILABILITY_RANK, availability_rank, |
341 | SEARCH_RANK_PIXBUF, pixbuf, | 334 | SEARCH_AVAILABILITY_CERTAINTY, |
342 | SEARCH_RANK_SORT, rank, | 335 | availability_certainty, |
343 | -1); | 336 | SEARCH_APPLICABILITY_RANK, |
344 | g_object_unref (pixbuf); | 337 | applicability_rank, SEARCH_RANK_PIXBUF, |
345 | return; /* done! */ | 338 | pixbuf, SEARCH_RANK_SORT, rank, -1); |
346 | } | 339 | g_object_unref (pixbuf); |
340 | return; /* done! */ | ||
341 | } | ||
347 | } | 342 | } |
348 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter)); | 343 | while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter)); |
349 | } | 344 | } |
350 | /* not found!? */ | 345 | /* not found!? */ |
351 | GNUNET_GE_BREAK(NULL, 0); | 346 | GNUNET_GE_BREAK (NULL, 0); |
352 | } | 347 | } |
353 | 348 | ||
354 | 349 | ||
@@ -361,10 +356,10 @@ on_search_display_metadata_activate (void *cls, GtkWidget * searchEntry) | |||
361 | GtkTreePath *path; | 356 | GtkTreePath *path; |
362 | GtkTreeIter iter; | 357 | GtkTreeIter iter; |
363 | struct GNUNET_ECRS_URI *uri; | 358 | struct GNUNET_ECRS_URI *uri; |
364 | struct GNUNET_ECRS_MetaData * meta; | 359 | struct GNUNET_ECRS_MetaData *meta; |
365 | char *str; | 360 | char *str; |
366 | GladeXML * xml; | 361 | GladeXML *xml; |
367 | GtkWidget * dialog; | 362 | GtkWidget *dialog; |
368 | 363 | ||
369 | path = NULL; | 364 | path = NULL; |
370 | if (FALSE == gtk_tree_view_get_path_at_pos (list->treeview, | 365 | if (FALSE == gtk_tree_view_get_path_at_pos (list->treeview, |
@@ -386,21 +381,14 @@ on_search_display_metadata_activate (void *cls, GtkWidget * searchEntry) | |||
386 | uri = NULL; | 381 | uri = NULL; |
387 | meta = NULL; | 382 | meta = NULL; |
388 | gtk_tree_model_get (GTK_TREE_MODEL (list->tree), | 383 | gtk_tree_model_get (GTK_TREE_MODEL (list->tree), |
389 | &iter, | 384 | &iter, SEARCH_URI, &uri, SEARCH_META, &meta, -1); |
390 | SEARCH_URI, &uri, | ||
391 | SEARCH_META, &meta, | ||
392 | -1); | ||
393 | str = GNUNET_ECRS_uri_to_string (uri); | 385 | str = GNUNET_ECRS_uri_to_string (uri); |
394 | xml = glade_xml_new(GNUNET_GTK_get_glade_filename (), | 386 | xml = glade_xml_new (GNUNET_GTK_get_glade_filename (), |
395 | "metaDisplayDialog", | 387 | "metaDisplayDialog", PACKAGE_NAME); |
396 | PACKAGE_NAME); | ||
397 | GNUNET_GTK_connect_glade_with_plugins (xml); | 388 | GNUNET_GTK_connect_glade_with_plugins (xml); |
398 | dialog = glade_xml_get_widget (xml, "metaDisplayDialog"); | 389 | dialog = glade_xml_get_widget (xml, "metaDisplayDialog"); |
399 | gtk_window_set_title(GTK_WINDOW(dialog), str); | 390 | gtk_window_set_title (GTK_WINDOW (dialog), str); |
400 | createMetaDataListTreeView(xml, | 391 | createMetaDataListTreeView (xml, "metaDisplayDialogTreeView", NULL, meta); |
401 | "metaDisplayDialogTreeView", | ||
402 | NULL, | ||
403 | meta); | ||
404 | gtk_dialog_run (GTK_DIALOG (dialog)); | 392 | gtk_dialog_run (GTK_DIALOG (dialog)); |
405 | GNUNET_free_non_null (str); | 393 | GNUNET_free_non_null (str); |
406 | gtk_widget_destroy (dialog); | 394 | gtk_widget_destroy (dialog); |
@@ -571,7 +559,8 @@ search_click_handler (void *cls, GdkEvent * event) | |||
571 | entry = gtk_menu_item_new_with_label (_("_Display metadata")); | 559 | entry = gtk_menu_item_new_with_label (_("_Display metadata")); |
572 | g_signal_connect_swapped (entry, | 560 | g_signal_connect_swapped (entry, |
573 | "activate", | 561 | "activate", |
574 | G_CALLBACK (on_search_display_metadata_activate), list); | 562 | G_CALLBACK (on_search_display_metadata_activate), |
563 | list); | ||
575 | gtk_label_set_use_underline (GTK_LABEL | 564 | gtk_label_set_use_underline (GTK_LABEL |
576 | (gtk_bin_get_child (GTK_BIN (entry))), TRUE); | 565 | (gtk_bin_get_child (GTK_BIN (entry))), TRUE); |
577 | gtk_widget_show (entry); | 566 | gtk_widget_show (entry); |
@@ -626,7 +615,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
626 | int i; | 615 | int i; |
627 | 616 | ||
628 | /* check that search does not already exist | 617 | /* check that search does not already exist |
629 | with fsui_list == NULL; | 618 | with fsui_list == NULL; |
630 | (and if so, hijack!) */ | 619 | (and if so, hijack!) */ |
631 | list = search_head; | 620 | list = search_head; |
632 | while (list != NULL) | 621 | while (list != NULL) |
@@ -646,7 +635,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
646 | } | 635 | } |
647 | 636 | ||
648 | /* build new entry */ | 637 | /* build new entry */ |
649 | if (GNUNET_ECRS_uri_test_ksk(uri)) | 638 | if (GNUNET_ECRS_uri_test_ksk (uri)) |
650 | description = GNUNET_ECRS_ksk_uri_to_human_readable_string (uri); | 639 | description = GNUNET_ECRS_ksk_uri_to_human_readable_string (uri); |
651 | else | 640 | else |
652 | description = GNUNET_NS_sks_uri_to_human_readable_string (ectx, cfg, uri); | 641 | description = GNUNET_NS_sks_uri_to_human_readable_string (ectx, cfg, uri); |
@@ -677,8 +666,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
677 | g_signal_connect_swapped (list->treeview, | 666 | g_signal_connect_swapped (list->treeview, |
678 | "button-press-event", | 667 | "button-press-event", |
679 | G_CALLBACK (search_click_handler), list); | 668 | G_CALLBACK (search_click_handler), list); |
680 | list->tree = gtk_tree_store_new (SEARCH_NUM, | 669 | list->tree = gtk_tree_store_new (SEARCH_NUM, G_TYPE_STRING, /* name */ |
681 | G_TYPE_STRING, /* name */ | ||
682 | G_TYPE_UINT64, /* size */ | 670 | G_TYPE_UINT64, /* size */ |
683 | G_TYPE_STRING, /* human-readable size */ | 671 | G_TYPE_STRING, /* human-readable size */ |
684 | G_TYPE_STRING, /* mime-type */ | 672 | G_TYPE_STRING, /* mime-type */ |
@@ -691,12 +679,12 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
691 | G_TYPE_POINTER, /* internal: search list */ | 679 | G_TYPE_POINTER, /* internal: search list */ |
692 | G_TYPE_POINTER, /* internal: download parent list */ | 680 | G_TYPE_POINTER, /* internal: download parent list */ |
693 | G_TYPE_STRING, /* status */ | 681 | G_TYPE_STRING, /* status */ |
694 | G_TYPE_INT, /* availability rank */ | 682 | G_TYPE_INT, /* availability rank */ |
695 | G_TYPE_UINT, /* availability certainty */ | 683 | G_TYPE_UINT, /* availability certainty */ |
696 | G_TYPE_UINT, /* applicability rank */ | 684 | G_TYPE_UINT, /* applicability rank */ |
697 | GDK_TYPE_PIXBUF, /* ranking visualization */ | 685 | GDK_TYPE_PIXBUF, /* ranking visualization */ |
698 | G_TYPE_INT64 /* numeric sort */ | 686 | G_TYPE_INT64 /* numeric sort */ |
699 | ); | 687 | ); |
700 | 688 | ||
701 | gtk_tree_view_set_model (list->treeview, GTK_TREE_MODEL (list->tree)); | 689 | gtk_tree_view_set_model (list->treeview, GTK_TREE_MODEL (list->tree)); |
702 | gtk_tree_selection_set_mode (gtk_tree_view_get_selection (list->treeview), | 690 | gtk_tree_selection_set_mode (gtk_tree_view_get_selection (list->treeview), |
@@ -770,36 +758,39 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
770 | gtk_tree_view_column_set_reorderable (column, TRUE); | 758 | gtk_tree_view_column_set_reorderable (column, TRUE); |
771 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_MIME); | 759 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_MIME); |
772 | 760 | ||
773 | #if 0 | 761 | #if 0 |
774 | /* colums for data visualized graphically */ | 762 | /* colums for data visualized graphically */ |
775 | renderer = gtk_cell_renderer_text_new (); | 763 | renderer = gtk_cell_renderer_text_new (); |
776 | gtk_tree_view_insert_column_with_attributes (list->treeview, | 764 | gtk_tree_view_insert_column_with_attributes (list->treeview, |
777 | -1, | 765 | -1, |
778 | _("Availability"), | 766 | _("Availability"), |
779 | renderer, | 767 | renderer, |
780 | "text", SEARCH_AVAILABILITY_RANK, | 768 | "text", |
781 | NULL); | 769 | SEARCH_AVAILABILITY_RANK, |
770 | NULL); | ||
782 | renderer = gtk_cell_renderer_text_new (); | 771 | renderer = gtk_cell_renderer_text_new (); |
783 | gtk_tree_view_insert_column_with_attributes (list->treeview, | 772 | gtk_tree_view_insert_column_with_attributes (list->treeview, |
784 | -1, | 773 | -1, |
785 | _("Certainty"), | 774 | _("Certainty"), |
786 | renderer, | 775 | renderer, |
787 | "text", SEARCH_AVAILABILITY_CERTAINTY, | 776 | "text", |
788 | NULL); | 777 | SEARCH_AVAILABILITY_CERTAINTY, |
778 | NULL); | ||
789 | renderer = gtk_cell_renderer_text_new (); | 779 | renderer = gtk_cell_renderer_text_new (); |
790 | gtk_tree_view_insert_column_with_attributes (list->treeview, | 780 | gtk_tree_view_insert_column_with_attributes (list->treeview, |
791 | -1, | 781 | -1, |
792 | _("Applicability"), | 782 | _("Applicability"), |
793 | renderer, | 783 | renderer, |
794 | "text", SEARCH_APPLICABILITY_RANK, | 784 | "text", |
795 | NULL); | 785 | SEARCH_APPLICABILITY_RANK, |
786 | NULL); | ||
796 | renderer = gtk_cell_renderer_text_new (); | 787 | renderer = gtk_cell_renderer_text_new (); |
797 | gtk_tree_view_insert_column_with_attributes (list->treeview, | 788 | gtk_tree_view_insert_column_with_attributes (list->treeview, |
798 | -1, | 789 | -1, |
799 | _("Sort"), | 790 | _("Sort"), |
800 | renderer, | 791 | renderer, |
801 | "text", SEARCH_RANK_SORT, | 792 | "text", SEARCH_RANK_SORT, |
802 | NULL); | 793 | NULL); |
803 | #endif | 794 | #endif |
804 | 795 | ||
805 | renderer = gtk_cell_renderer_pixbuf_new (); | 796 | renderer = gtk_cell_renderer_pixbuf_new (); |
@@ -807,7 +798,8 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
807 | -1, | 798 | -1, |
808 | _("Ranking"), | 799 | _("Ranking"), |
809 | renderer, | 800 | renderer, |
810 | "pixbuf", SEARCH_RANK_PIXBUF, | 801 | "pixbuf", |
802 | SEARCH_RANK_PIXBUF, | ||
811 | NULL); | 803 | NULL); |
812 | column = gtk_tree_view_get_column (list->treeview, col - 1); | 804 | column = gtk_tree_view_get_column (list->treeview, col - 1); |
813 | gtk_tree_view_column_set_resizable (column, FALSE); | 805 | gtk_tree_view_column_set_resizable (column, FALSE); |
@@ -913,10 +905,7 @@ freeIterSubtree (GtkTreeModel * tree, GtkTreeIter * iter) | |||
913 | if (meta != NULL) | 905 | if (meta != NULL) |
914 | GNUNET_ECRS_meta_data_destroy (meta); | 906 | GNUNET_ECRS_meta_data_destroy (meta); |
915 | gtk_tree_store_set (GTK_TREE_STORE (tree), | 907 | gtk_tree_store_set (GTK_TREE_STORE (tree), |
916 | iter, | 908 | iter, SEARCH_URI, NULL, SEARCH_META, NULL, -1); |
917 | SEARCH_URI, NULL, | ||
918 | SEARCH_META, NULL, | ||
919 | -1); | ||
920 | if (gtk_tree_model_iter_children (tree, &child, iter)) | 909 | if (gtk_tree_model_iter_children (tree, &child, iter)) |
921 | freeIterSubtree (tree, &child); | 910 | freeIterSubtree (tree, &child); |
922 | } | 911 | } |
@@ -1229,7 +1218,7 @@ on_closeSearchButton_clicked_fs (GtkWidget * searchPage, | |||
1229 | GNUNET_GE_ASSERT (ectx, list != NULL); | 1218 | GNUNET_GE_ASSERT (ectx, list != NULL); |
1230 | if (list->fsui_list == NULL) | 1219 | if (list->fsui_list == NULL) |
1231 | { | 1220 | { |
1232 | /* open directory or paused search; | 1221 | /* open directory or paused search; |
1233 | close directly */ | 1222 | close directly */ |
1234 | fs_search_stopped (list); | 1223 | fs_search_stopped (list); |
1235 | } | 1224 | } |