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.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index 402aa1c1..d2679f5a 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -58,12 +58,12 @@ static void updateSearchSummary(SearchList * searchContext) {
58 &iter, 58 &iter,
59 SEARCH_SUMMARY_RESULT_COUNT, searchContext->resultsReceived, 59 SEARCH_SUMMARY_RESULT_COUNT, searchContext->resultsReceived,
60 -1); 60 -1);
61 61
62 62
63 63
64 /* update tab title with the number of results */ 64 /* update tab title with the number of results */
65 new_title = 65 new_title =
66 g_strdup_printf("%s (%u)", 66 g_strdup_printf("%s (%u)",
67 searchContext->searchString, 67 searchContext->searchString,
68 searchContext->resultsReceived); 68 searchContext->resultsReceived);
69 label = GTK_LABEL(glade_xml_get_widget(searchContext->labelXML, 69 label = GTK_LABEL(glade_xml_get_widget(searchContext->labelXML,
@@ -89,7 +89,7 @@ void addEntryToSearchTree(SearchList * searchContext,
89 89
90 mime = getMimeTypeFromMetaData(info->meta); 90 mime = getMimeTypeFromMetaData(info->meta);
91 desc = getDescriptionFromMetaData(info->meta); 91 desc = getDescriptionFromMetaData(info->meta);
92 name = getFileNameFromMetaData(info->meta); 92 name = getFileNameFromMetaData(info->meta);
93 size = ECRS_isFileUri(info->uri) ? ECRS_fileSize(info->uri) : 0; 93 size = ECRS_isFileUri(info->uri) ? ECRS_fileSize(info->uri) : 0;
94 pixbuf = getThumbnailFromMetaData(info->meta); 94 pixbuf = getThumbnailFromMetaData(info->meta);
95 size_h = string_get_fancy_byte_size(size); 95 size_h = string_get_fancy_byte_size(size);
@@ -115,7 +115,7 @@ void addEntryToSearchTree(SearchList * searchContext,
115/** 115/**
116 * Add the given result to the model (search result 116 * Add the given result to the model (search result
117 * list). 117 * list).
118 * 118 *
119 * @param info the information to add to the model 119 * @param info the information to add to the model
120 * @param uri the search URI 120 * @param uri the search URI
121 * @param searchContext identifies the search page 121 * @param searchContext identifies the search page
@@ -129,7 +129,7 @@ void fs_search_result_received(SearchList * searchContext,
129 model = GTK_TREE_STORE(gtk_tree_view_get_model(searchContext->treeview)); 129 model = GTK_TREE_STORE(gtk_tree_view_get_model(searchContext->treeview));
130 gtk_tree_store_append(model, 130 gtk_tree_store_append(model,
131 &iter, 131 &iter,
132 NULL); 132 NULL);
133 addEntryToSearchTree(searchContext, 133 addEntryToSearchTree(searchContext,
134 NULL, 134 NULL,
135 info, 135 info,
@@ -142,7 +142,7 @@ void fs_search_result_received(SearchList * searchContext,
142 * FSUI event: a search was started; create the 142 * FSUI event: a search was started; create the
143 * tab and add an entry to the summary. 143 * tab and add an entry to the summary.
144 */ 144 */
145SearchList * 145SearchList *
146fs_search_started(struct FSUI_SearchList * fsui_list, 146fs_search_started(struct FSUI_SearchList * fsui_list,
147 const struct ECRS_URI * uri, 147 const struct ECRS_URI * uri,
148 unsigned int anonymityLevel, 148 unsigned int anonymityLevel,
@@ -186,7 +186,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
186 = STRDUP(dhead); 186 = STRDUP(dhead);
187 list->uri 187 list->uri
188 = ECRS_dupUri(uri); 188 = ECRS_dupUri(uri);
189 list->fsui_list 189 list->fsui_list
190 = fsui_list; 190 = fsui_list;
191 list->next 191 list->next
192 = search_head; 192 = search_head;
@@ -196,7 +196,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
196 "searchResultsFrame", 196 "searchResultsFrame",
197 PACKAGE_NAME); 197 PACKAGE_NAME);
198 connectGladeWithPlugins(list->searchXML); 198 connectGladeWithPlugins(list->searchXML);
199 list->searchpage 199 list->searchpage
200 = extractMainWidgetFromWindow(list->searchXML, 200 = extractMainWidgetFromWindow(list->searchXML,
201 "searchResultsFrame"); 201 "searchResultsFrame");
202 /* setup tree view and renderers */ 202 /* setup tree view and renderers */
@@ -263,7 +263,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
263 gtk_tree_view_column_set_clickable(column, TRUE); 263 gtk_tree_view_column_set_clickable(column, TRUE);
264 gtk_tree_view_column_set_reorderable(column, TRUE); 264 gtk_tree_view_column_set_reorderable(column, TRUE);
265 gtk_tree_view_column_set_sort_column_id(column, SEARCH_MIME); 265 gtk_tree_view_column_set_sort_column_id(column, SEARCH_MIME);
266 266
267 renderer = gtk_cell_renderer_text_new(); 267 renderer = gtk_cell_renderer_text_new();
268 col = gtk_tree_view_insert_column_with_attributes(list->treeview, 268 col = gtk_tree_view_insert_column_with_attributes(list->treeview,
269 -1, 269 -1,
@@ -313,14 +313,14 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
313 = gtk_tree_row_reference_new(GTK_TREE_MODEL(search_summary), 313 = gtk_tree_row_reference_new(GTK_TREE_MODEL(search_summary),
314 path); 314 path);
315 gtk_tree_path_free(path); 315 gtk_tree_path_free(path);
316 316
317 /* load label */ 317 /* load label */
318 list->labelXML 318 list->labelXML
319 = glade_xml_new(getGladeFileName(), 319 = glade_xml_new(getGladeFileName(),
320 "searchTabLabelWindow", 320 "searchTabLabelWindow",
321 PACKAGE_NAME); 321 PACKAGE_NAME);
322 connectGladeWithPlugins(list->labelXML); 322 connectGladeWithPlugins(list->labelXML);
323 list->tab_label 323 list->tab_label
324 = extractMainWidgetFromWindow(list->labelXML, 324 = extractMainWidgetFromWindow(list->labelXML,
325 "searchTabLabelWindow"); 325 "searchTabLabelWindow");
326 /* process existing results */ 326 /* process existing results */
@@ -330,11 +330,11 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
330 uri); 330 uri);
331 if (resultCount == 0) /* otherwise already done! */ 331 if (resultCount == 0) /* otherwise already done! */
332 updateSearchSummary(list); 332 updateSearchSummary(list);
333 333
334 /* insert new page into search notebook */ 334 /* insert new page into search notebook */
335 notebook 335 notebook
336 = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(), 336 = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(),
337 "downloadNotebook")); 337 "downloadNotebook"));
338 pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)); 338 pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
339 gtk_notebook_append_page(notebook, 339 gtk_notebook_append_page(notebook,
340 list->searchpage, 340 list->searchpage,
@@ -342,7 +342,7 @@ fs_search_started(struct FSUI_SearchList * fsui_list,
342 gtk_notebook_set_current_page(notebook, 342 gtk_notebook_set_current_page(notebook,
343 pages); 343 pages);
344 gtk_widget_show(GTK_WIDGET(notebook)); /* may have been hidden! */ 344 gtk_widget_show(GTK_WIDGET(notebook)); /* may have been hidden! */
345 345
346 return list; 346 return list;
347} 347}
348 348
@@ -407,7 +407,7 @@ void fs_search_stopped(SearchList * list) {
407 search_head = search_head->next; 407 search_head = search_head->next;
408 } else { 408 } else {
409 prev = search_head; 409 prev = search_head;
410 while (prev->next != list) 410 while (prev->next != list)
411 prev = prev->next; 411 prev = prev->next;
412 prev->next = list->next; 412 prev->next = list->next;
413 } 413 }
@@ -435,13 +435,13 @@ void fs_search_stopped(SearchList * list) {
435 GE_BREAK(ectx, index != -1); 435 GE_BREAK(ectx, index != -1);
436 gtk_notebook_remove_page(notebook, 436 gtk_notebook_remove_page(notebook,
437 index); 437 index);
438 438
439 /* recursively free search model */ 439 /* recursively free search model */
440 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list->tree), 440 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list->tree),
441 &iter)) 441 &iter))
442 freeIterSubtree(GTK_TREE_MODEL(list->tree), 442 freeIterSubtree(GTK_TREE_MODEL(list->tree),
443 &iter); 443 &iter);
444 444
445 /* destroy entry in summary */ 445 /* destroy entry in summary */
446 path = gtk_tree_row_reference_get_path(list->summaryViewRowReference); 446 path = gtk_tree_row_reference_get_path(list->summaryViewRowReference);
447 gtk_tree_model_get_iter(GTK_TREE_MODEL(search_summary), 447 gtk_tree_model_get_iter(GTK_TREE_MODEL(search_summary),
@@ -611,7 +611,7 @@ static void * fsui_callback(void * cls) {
611 * search notebook. Note that "searchPage" can thus 611 * search notebook. Note that "searchPage" can thus
612 * either refer to the main page in the tab or to the 612 * either refer to the main page in the tab or to the
613 * main entry of the tab label. 613 * main entry of the tab label.
614 */ 614 */
615void on_closeSearchButton_clicked_fs(GtkWidget * searchPage, 615void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
616 GtkWidget * closeButton) { 616 GtkWidget * closeButton) {
617 SearchList * list; 617 SearchList * list;