diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-06-07 07:13:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-06-07 07:13:27 +0000 |
commit | f59617c7964f5738cd45087a1b3fa165082831b5 (patch) | |
tree | 25ebc2bb3e6b555fee2004a8d2ac4808fe43935e | |
parent | 75924f582743c951c09c48b1122ca4db01492207 (diff) | |
download | gnunet-gtk-f59617c7964f5738cd45087a1b3fa165082831b5.tar.gz gnunet-gtk-f59617c7964f5738cd45087a1b3fa165082831b5.zip |
keep raw mime for sorting
-rw-r--r-- | src/plugins/fs/fs.h | 1 | ||||
-rw-r--r-- | src/plugins/fs/search.c | 37 |
2 files changed, 21 insertions, 17 deletions
diff --git a/src/plugins/fs/fs.h b/src/plugins/fs/fs.h index 8e567071..9ab34778 100644 --- a/src/plugins/fs/fs.h +++ b/src/plugins/fs/fs.h | |||
@@ -58,6 +58,7 @@ enum | |||
58 | SEARCH_SIZE, | 58 | SEARCH_SIZE, |
59 | SEARCH_HSIZE, | 59 | SEARCH_HSIZE, |
60 | SEARCH_MIME, | 60 | SEARCH_MIME, |
61 | SEARCH_RAW_MIME, | ||
61 | SEARCH_DESC, | 62 | SEARCH_DESC, |
62 | SEARCH_PIXBUF, | 63 | SEARCH_PIXBUF, |
63 | SEARCH_URI, | 64 | SEARCH_URI, |
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index b6fc58b2..0d000a60 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -262,7 +262,8 @@ addEntryToSearchTree (SearchList * searchContext, | |||
262 | SEARCH_ICON, icon, | 262 | SEARCH_ICON, icon, |
263 | #endif | 263 | #endif |
264 | SEARCH_NAME, name, SEARCH_SIZE, size, SEARCH_HSIZE, | 264 | SEARCH_NAME, name, SEARCH_SIZE, size, SEARCH_HSIZE, |
265 | size_h, SEARCH_MIME, mime, SEARCH_DESC, desc, | 265 | size_h, SEARCH_MIME, mime, |
266 | SEARCH_RAW_MIME, rawMime, SEARCH_DESC, desc, | ||
266 | SEARCH_PIXBUF, pixbuf, SEARCH_URI, | 267 | SEARCH_PIXBUF, pixbuf, SEARCH_URI, |
267 | GNUNET_ECRS_uri_duplicate (info->uri), SEARCH_META, | 268 | GNUNET_ECRS_uri_duplicate (info->uri), SEARCH_META, |
268 | GNUNET_meta_data_duplicate (info->meta), | 269 | GNUNET_meta_data_duplicate (info->meta), |
@@ -416,7 +417,7 @@ on_search_display_metadata_activate (void *cls, GtkWidget * searchEntry) | |||
416 | list->last_y, | 417 | list->last_y, |
417 | &path, NULL, NULL, NULL)) | 418 | &path, NULL, NULL, NULL)) |
418 | { | 419 | { |
419 | GNUNET_GE_BREAK (NULL, 0); | 420 | /* nothing selected */ |
420 | return FALSE; | 421 | return FALSE; |
421 | } | 422 | } |
422 | if (FALSE == gtk_tree_model_get_iter (GTK_TREE_MODEL (list->tree), | 423 | if (FALSE == gtk_tree_model_get_iter (GTK_TREE_MODEL (list->tree), |
@@ -723,6 +724,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
723 | G_TYPE_UINT64, /* size */ | 724 | G_TYPE_UINT64, /* size */ |
724 | G_TYPE_STRING, /* human-readable size */ | 725 | G_TYPE_STRING, /* human-readable size */ |
725 | G_TYPE_STRING, /* mime-type */ | 726 | G_TYPE_STRING, /* mime-type */ |
727 | G_TYPE_STRING, /* raw mime-type */ | ||
726 | G_TYPE_STRING, /* meta-data (some) */ | 728 | G_TYPE_STRING, /* meta-data (some) */ |
727 | GDK_TYPE_PIXBUF, /* preview */ | 729 | GDK_TYPE_PIXBUF, /* preview */ |
728 | G_TYPE_POINTER, /* url */ | 730 | G_TYPE_POINTER, /* url */ |
@@ -765,20 +767,6 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
765 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_STATUS); | 767 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_STATUS); |
766 | gtk_tree_view_column_set_min_width (column, 0); | 768 | gtk_tree_view_column_set_min_width (column, 0); |
767 | 769 | ||
768 | #ifdef HAVE_GIO | ||
769 | renderer = gtk_cell_renderer_pixbuf_new (); | ||
770 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, | ||
771 | -1, | ||
772 | NULL, | ||
773 | renderer, | ||
774 | "pixbuf", | ||
775 | SEARCH_ICON, NULL); | ||
776 | column = gtk_tree_view_get_column (list->treeview, col - 1); | ||
777 | gtk_tree_view_column_set_resizable (column, TRUE); | ||
778 | gtk_tree_view_column_set_reorderable (column, FALSE); | ||
779 | gtk_tree_view_column_set_min_width (column, 20); | ||
780 | #endif | ||
781 | |||
782 | renderer = gtk_cell_renderer_text_new (); | 770 | renderer = gtk_cell_renderer_text_new (); |
783 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, | 771 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, |
784 | -1, | 772 | -1, |
@@ -809,6 +797,20 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
809 | gtk_tree_view_column_set_reorderable (column, TRUE); | 797 | gtk_tree_view_column_set_reorderable (column, TRUE); |
810 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_SIZE); | 798 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_SIZE); |
811 | 799 | ||
800 | #ifdef HAVE_GIO | ||
801 | renderer = gtk_cell_renderer_pixbuf_new (); | ||
802 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, | ||
803 | -1, | ||
804 | _("Type"), | ||
805 | renderer, | ||
806 | "pixbuf", | ||
807 | SEARCH_ICON, NULL); | ||
808 | column = gtk_tree_view_get_column (list->treeview, col - 1); | ||
809 | gtk_tree_view_column_set_resizable (column, TRUE); | ||
810 | gtk_tree_view_column_set_reorderable (column, TRUE); | ||
811 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_RAW_MIME); | ||
812 | gtk_tree_view_column_set_min_width (column, 20); | ||
813 | #else | ||
812 | renderer = gtk_cell_renderer_text_new (); | 814 | renderer = gtk_cell_renderer_text_new (); |
813 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, | 815 | col = gtk_tree_view_insert_column_with_attributes (list->treeview, |
814 | -1, | 816 | -1, |
@@ -823,7 +825,8 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list, | |||
823 | gtk_tree_view_column_set_resizable (column, TRUE); | 825 | gtk_tree_view_column_set_resizable (column, TRUE); |
824 | gtk_tree_view_column_set_clickable (column, TRUE); | 826 | gtk_tree_view_column_set_clickable (column, TRUE); |
825 | gtk_tree_view_column_set_reorderable (column, TRUE); | 827 | gtk_tree_view_column_set_reorderable (column, TRUE); |
826 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_MIME); | 828 | gtk_tree_view_column_set_sort_column_id (column, SEARCH_RAW_MIME); |
829 | #endif | ||
827 | 830 | ||
828 | #if 0 | 831 | #if 0 |
829 | /* colums for data visualized graphically */ | 832 | /* colums for data visualized graphically */ |