aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r--src/plugins/fs/search.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index 055f126d..5afa8621 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -73,7 +73,7 @@ updateSearchSummary (SearchList * searchContext)
73 if (TRUE != 73 if (TRUE !=
74 gtk_tree_model_get_iter (GTK_TREE_MODEL (search_summary), &iter, path)) 74 gtk_tree_model_get_iter (GTK_TREE_MODEL (search_summary), &iter, path))
75 { 75 {
76 GNUNET_GEBREAK (ectx, 0); 76 GNUNET_GE_BREAK (ectx, 0);
77 return; 77 return;
78 } 78 }
79 gtk_tree_path_free (path); 79 gtk_tree_path_free (path);
@@ -112,7 +112,7 @@ addEntryToSearchTree (SearchList * searchContext,
112 unsigned long long size; 112 unsigned long long size;
113 char *size_h; 113 char *size_h;
114 GdkPixbuf *pixbuf; 114 GdkPixbuf *pixbuf;
115 enum URITRACK_STATE state; 115 enum GNUNET_URITRACK_STATE state;
116 116
117 state = GNUNET_URITRACK_get_state (ectx, cfg, info->uri); 117 state = GNUNET_URITRACK_get_state (ectx, cfg, info->uri);
118 mime = getMimeTypeFromMetaData (info->meta); 118 mime = getMimeTypeFromMetaData (info->meta);
@@ -120,8 +120,8 @@ addEntryToSearchTree (SearchList * searchContext,
120 name = getFileNameFromMetaData (info->meta); 120 name = getFileNameFromMetaData (info->meta);
121 size = GNUNET_ECRS_uri_test_chk (info->uri) 121 size = GNUNET_ECRS_uri_test_chk (info->uri)
122 || GNUNET_ECRS_uri_test_loc (info-> 122 || GNUNET_ECRS_uri_test_loc (info->
123 uri) ? GNUNET_ECRS_uri_get_file_siz (info-> 123 uri) ? GNUNET_ECRS_uri_get_file_size (info->
124 uri) : 124 uri) :
125 0; 125 0;
126 pixbuf = getThumbnailFromMetaData (info->meta); 126 pixbuf = getThumbnailFromMetaData (info->meta);
127 size_h = GNUNET_get_byte_size_as_fancy_string (size); 127 size_h = GNUNET_get_byte_size_as_fancy_string (size);
@@ -163,7 +163,7 @@ fs_search_result_received (SearchList * searchContext,
163{ 163{
164 GtkTreeStore *model; 164 GtkTreeStore *model;
165 GtkTreeIter iter; 165 GtkTreeIter iter;
166 enum URITRACK_STATE state; 166 enum GNUNET_URITRACK_STATE state;
167 167
168 state = GNUNET_URITRACK_get_state (ectx, cfg, info->uri); 168 state = GNUNET_URITRACK_get_state (ectx, cfg, info->uri);
169 if ((state & (GNUNET_URITRACK_INSERTED | 169 if ((state & (GNUNET_URITRACK_INSERTED |
@@ -196,13 +196,13 @@ on_search_copy_uri_activate (void *cls, GtkWidget * searchEntry)
196 list->last_y, 196 list->last_y,
197 &path, NULL, NULL, NULL)) 197 &path, NULL, NULL, NULL))
198 { 198 {
199 GNUNET_GEBREAK (NULL, 0); 199 GNUNET_GE_BREAK (NULL, 0);
200 return FALSE; 200 return FALSE;
201 } 201 }
202 if (FALSE == gtk_tree_model_get_iter (GTK_TREE_MODEL (list->tree), 202 if (FALSE == gtk_tree_model_get_iter (GTK_TREE_MODEL (list->tree),
203 &iter, path)) 203 &iter, path))
204 { 204 {
205 GNUNET_GEBREAK (NULL, 0); 205 GNUNET_GE_BREAK (NULL, 0);
206 gtk_tree_path_free (path); 206 gtk_tree_path_free (path);
207 return FALSE; 207 return FALSE;
208 } 208 }
@@ -228,7 +228,7 @@ selectFile ()
228 228
229 uploadXML 229 uploadXML
230 = glade_xml_new (GNUNET_GTK_get_glade_filename (), 230 = glade_xml_new (GNUNET_GTK_get_glade_filename (),
231 "directorySaveDialog", PACKAGNUNET_GENAME); 231 "directorySaveDialog", PACKAGNUNET_GE_NAME);
232 GNUNET_GTK_connect_glade_with_plugins (uploadXML); 232 GNUNET_GTK_connect_glade_with_plugins (uploadXML);
233 dialog = GTK_FILE_CHOOSER (glade_xml_get_widget (uploadXML, 233 dialog = GTK_FILE_CHOOSER (glade_xml_get_widget (uploadXML,
234 "directorySaveDialog")); 234 "directorySaveDialog"));
@@ -302,7 +302,7 @@ on_save_search_activate (void *cls, GtkWidget * searchEntry)
302 fis_size, fis, meta)) 302 fis_size, fis, meta))
303 { 303 {
304 GNUNET_GTK_add_log_entry (_("Internal error.")); 304 GNUNET_GTK_add_log_entry (_("Internal error."));
305 GNUNET_GEBREAK (NULL, 0); 305 GNUNET_GE_BREAK (NULL, 0);
306 GNUNET_ECRS_meta_data_destroy (meta); 306 GNUNET_ECRS_meta_data_destroy (meta);
307 GNUNET_array_grow (fis, fis_size, 0); 307 GNUNET_array_grow (fis, fis_size, 0);
308 GNUNET_free (name); 308 GNUNET_free (name);
@@ -387,11 +387,11 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list,
387 description = GNUNET_ECRS_uri_to_string (uri); 387 description = GNUNET_ECRS_uri_to_string (uri);
388 if (description == NULL) 388 if (description == NULL)
389 { 389 {
390 GNUNET_GEBREAK (ectx, 0); 390 GNUNET_GE_BREAK (ectx, 0);
391 return NULL; 391 return NULL;
392 } 392 }
393 GNUNET_GEASSERT (ectx, 393 GNUNET_GE_ASSERT (ectx,
394 strlen (description) >= strlen (GNUNET_ECRS_URI_PREFIX)); 394 strlen (description) >= strlen (GNUNET_ECRS_URI_PREFIX));
395 dhead = &description[strlen (GNUNET_ECRS_URI_PREFIX)]; 395 dhead = &description[strlen (GNUNET_ECRS_URI_PREFIX)];
396 if (0 == 396 if (0 ==
397 strncmp (dhead, GNUNET_ECRS_SEARCH_INFIX, 397 strncmp (dhead, GNUNET_ECRS_SEARCH_INFIX,
@@ -411,7 +411,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list,
411 list->searchXML 411 list->searchXML
412 = 412 =
413 glade_xml_new (GNUNET_GTK_get_glade_filename (), "searchResultsFrame", 413 glade_xml_new (GNUNET_GTK_get_glade_filename (), "searchResultsFrame",
414 PACKAGNUNET_GENAME); 414 PACKAGNUNET_GE_NAME);
415 GNUNET_GTK_connect_glade_with_plugins (list->searchXML); 415 GNUNET_GTK_connect_glade_with_plugins (list->searchXML);
416 list->searchpage 416 list->searchpage
417 = extractMainWidgetFromWindow (list->searchXML, "searchResultsFrame"); 417 = extractMainWidgetFromWindow (list->searchXML, "searchResultsFrame");
@@ -545,7 +545,7 @@ fs_search_started (struct GNUNET_FSUI_SearchList * fsui_list,
545 /* load label */ 545 /* load label */
546 list->labelXML 546 list->labelXML
547 = glade_xml_new (GNUNET_GTK_get_glade_filename (), 547 = glade_xml_new (GNUNET_GTK_get_glade_filename (),
548 "searchTabLabelWindow", PACKAGNUNET_GENAME); 548 "searchTabLabelWindow", PACKAGNUNET_GE_NAME);
549 GNUNET_GTK_connect_glade_with_plugins (list->labelXML); 549 GNUNET_GTK_connect_glade_with_plugins (list->labelXML);
550 list->tab_label 550 list->tab_label
551 = extractMainWidgetFromWindow (list->labelXML, "searchTabLabelWindow"); 551 = extractMainWidgetFromWindow (list->labelXML, "searchTabLabelWindow");
@@ -657,7 +657,7 @@ fs_search_stopped (SearchList * list)
657 for (i = gtk_notebook_get_n_pages (notebook) - 1; i >= 0; i--) 657 for (i = gtk_notebook_get_n_pages (notebook) - 1; i >= 0; i--)
658 if (list->searchpage == gtk_notebook_get_nth_page (notebook, i)) 658 if (list->searchpage == gtk_notebook_get_nth_page (notebook, i))
659 index = i; 659 index = i;
660 GNUNET_GEBREAK (ectx, index != -1); 660 GNUNET_GE_BREAK (ectx, index != -1);
661 gtk_notebook_remove_page (notebook, index); 661 gtk_notebook_remove_page (notebook, index);
662 /* recursively free search model */ 662 /* recursively free search model */
663 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->tree), &iter)) 663 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list->tree), &iter))
@@ -736,9 +736,9 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton)
736 "fssearchKeywordComboBoxEntry"); 736 "fssearchKeywordComboBoxEntry");
737 if ((searchString == NULL) || (strlen (searchString) == 0)) 737 if ((searchString == NULL) || (strlen (searchString) == 0))
738 { 738 {
739 GNUNET_GELOG (ectx, 739 GNUNET_GE_LOG (ectx,
740 GNUNET_GEERROR | GNUNET_GEUSER | GNUNET_GEIMMEDIATE, 740 GNUNET_GE_ERROR | GNUNET_GE_USER | GNUNET_GE_IMMEDIATE,
741 _("Need a keyword to search!\n")); 741 _("Need a keyword to search!\n"));
742 return; 742 return;
743 } 743 }
744 /* add the keyword to the list of keywords that have 744 /* add the keyword to the list of keywords that have
@@ -781,7 +781,7 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton)
781 } 781 }
782 else 782 else
783 { 783 {
784 GNUNET_GEASSERT (ectx, strlen (ns) == sizeof (GNUNET_EncName) - 1); 784 GNUNET_GE_ASSERT (ectx, strlen (ns) == sizeof (GNUNET_EncName) - 1);
785 if ((descStr == NULL) && (ns != NULL)) 785 if ((descStr == NULL) && (ns != NULL))
786 descStr = GNUNET_strdup (ns); 786 descStr = GNUNET_strdup (ns);
787 } 787 }
@@ -801,10 +801,11 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton)
801 fsss.uri = GNUNET_ECRS_string_to_uri (ectx, ustring); 801 fsss.uri = GNUNET_ECRS_string_to_uri (ectx, ustring);
802 if (fsss.uri == NULL) 802 if (fsss.uri == NULL)
803 { 803 {
804 GNUNET_GELOG (ectx, 804 GNUNET_GE_LOG (ectx,
805 GNUNET_GEERROR | GNUNET_GEBULK | GNUNET_GEUSER, 805 GNUNET_GE_ERROR | GNUNET_GE_BULK |
806 _("Failed to create namespace URI from `%s'.\n"), 806 GNUNET_GE_USER,
807 ustring); 807 _("Failed to create namespace URI from `%s'.\n"),
808 ustring);
808 } 809 }
809 GNUNET_free (ustring); 810 GNUNET_free (ustring);
810 } 811 }
@@ -817,7 +818,7 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton)
817 fsss.uri = GNUNET_ECRS_keyword_string_to_uri (ectx, searchString); 818 fsss.uri = GNUNET_ECRS_keyword_string_to_uri (ectx, searchString);
818 if (fsss.uri == NULL) 819 if (fsss.uri == NULL)
819 { 820 {
820 GNUNET_GEBREAK (ectx, 0); 821 GNUNET_GE_BREAK (ectx, 0);
821 return; 822 return;
822 } 823 }
823 /* check if search is already running */ 824 /* check if search is already running */
@@ -840,7 +841,7 @@ on_fssearchbutton_clicked_fs (gpointer dummy2, GtkWidget * searchButton)
840 return; 841 return;
841 } 842 }
842 } 843 }
843 GNUNET_GEBREAK (ectx, 0); 844 GNUNET_GE_BREAK (ectx, 0);
844 } 845 }
845 list = list->next; 846 list = list->next;
846 } 847 }
@@ -893,7 +894,7 @@ on_closeSearchButton_clicked_fs (GtkWidget * searchPage,
893 break; 894 break;
894 list = list->next; 895 list = list->next;
895 } 896 }
896 GNUNET_GEASSERT (ectx, list != NULL); 897 GNUNET_GE_ASSERT (ectx, list != NULL);
897 if (list->fsui_list == NULL) 898 if (list->fsui_list == NULL)
898 { 899 {
899 /* open directory - close directly */ 900 /* open directory - close directly */
@@ -927,7 +928,7 @@ on_abortSearchButton_clicked_fs (GtkWidget * searchPage,
927 break; 928 break;
928 list = list->next; 929 list = list->next;
929 } 930 }
930 GNUNET_GEASSERT (ectx, list != NULL); 931 GNUNET_GE_ASSERT (ectx, list != NULL);
931 if (list->fsui_list != NULL) 932 if (list->fsui_list != NULL)
932 { 933 {
933 fcbc.method = &GNUNET_FSUI_search_abort; 934 fcbc.method = &GNUNET_FSUI_search_abort;