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.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index acb046c6..71744feb 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -588,6 +588,19 @@ void on_fssearchbutton_clicked_fs(gpointer dummy2,
588 uri); 588 uri);
589} 589}
590 590
591struct FCBC {
592 int (*method)(struct FSUI_Context * ctx,
593 struct FSUI_SearchList * list);
594 struct FSUI_SearchList * argument;
595};
596
597static void * fsui_callback(void * cls) {
598 struct FCBC * fcbc = cls;
599 fcbc->method(ctx,
600 fcbc->argument);
601 return NULL;
602}
603
591/** 604/**
592 * This method is called when the user clicks on either 605 * This method is called when the user clicks on either
593 * the "CLOSE" button (at the bottom of the search page) 606 * the "CLOSE" button (at the bottom of the search page)
@@ -599,6 +612,7 @@ void on_fssearchbutton_clicked_fs(gpointer dummy2,
599void on_closeSearchButton_clicked_fs(GtkWidget * searchPage, 612void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
600 GtkWidget * closeButton) { 613 GtkWidget * closeButton) {
601 SearchList * list; 614 SearchList * list;
615 struct FCBC fcbc;
602 616
603 list = search_head; 617 list = search_head;
604 while (list != NULL) { 618 while (list != NULL) {
@@ -608,8 +622,10 @@ void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
608 list = list->next; 622 list = list->next;
609 } 623 }
610 GE_ASSERT(ectx, list != NULL); 624 GE_ASSERT(ectx, list != NULL);
611 FSUI_stopSearch(ctx, 625 fcbc.method = &FSUI_stopSearch;
612 list->fsui_list); 626 fcbc.argument = list->fsui_list;
627 run_with_save_calls(&fsui_callback,
628 &fcbc);
613} 629}
614 630
615/** 631/**
@@ -635,15 +651,19 @@ static void stopSearch(GtkTreeModel * model,
635 GtkTreeIter * iter, 651 GtkTreeIter * iter,
636 gpointer unused) { 652 gpointer unused) {
637 SearchList * s; 653 SearchList * s;
654 struct FCBC fcbc;
638 655
639 s = NULL; 656 s = NULL;
640 gtk_tree_model_get(model, 657 gtk_tree_model_get(model,
641 iter, 658 iter,
642 SEARCH_SUMMARY_INTERNAL, &s, 659 SEARCH_SUMMARY_INTERNAL, &s,
643 -1); 660 -1);
644 if (s != NULL) 661 if (s != NULL) {
645 FSUI_stopSearch(ctx, 662 fcbc.method = &FSUI_stopSearch;
646 s->fsui_list); 663 fcbc.argument = s->fsui_list;
664 run_with_save_calls(&fsui_callback,
665 &fcbc);
666 }
647} 667}
648 668
649/** 669/**
@@ -665,15 +685,19 @@ static void abortSearch(GtkTreeModel * model,
665 GtkTreeIter * iter, 685 GtkTreeIter * iter,
666 gpointer unused) { 686 gpointer unused) {
667 SearchList * s; 687 SearchList * s;
688 struct FCBC fcbc;
668 689
669 s = NULL; 690 s = NULL;
670 gtk_tree_model_get(model, 691 gtk_tree_model_get(model,
671 iter, 692 iter,
672 SEARCH_SUMMARY_INTERNAL, &s, 693 SEARCH_SUMMARY_INTERNAL, &s,
673 -1); 694 -1);
674 if (s != NULL) 695 if (s != NULL) {
675 FSUI_abortSearch(ctx, 696 fcbc.method = &FSUI_abortSearch;
676 s->fsui_list); 697 fcbc.argument = s->fsui_list;
698 run_with_save_calls(&fsui_callback,
699 &fcbc);
700 }
677} 701}
678 702
679/** 703/**