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, 34 insertions, 21 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c
index a851b6cb..5c2b0df7 100644
--- a/src/plugins/fs/search.c
+++ b/src/plugins/fs/search.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2005, 2006 Christian Grothoff (and other contributing authors) 3 (C) 2005, 2006, 2007 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -908,13 +908,19 @@ void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
908 list = list->next; 908 list = list->next;
909 } 909 }
910 GE_ASSERT(ectx, list != NULL); 910 GE_ASSERT(ectx, list != NULL);
911 fcbc.method = &FSUI_abortSearch; 911 if (list->fsui_list == NULL) {
912 fcbc.argument = list->fsui_list; 912 /* open directory - close directly */
913 run_with_save_calls(&fsui_callback, 913 fs_search_stopped(list);
914 &fcbc); 914 } else {
915 fcbc.method = &FSUI_stopSearch; 915 /* actual search - close via FSUI */
916 run_with_save_calls(&fsui_callback, 916 fcbc.method = &FSUI_abortSearch;
917 &fcbc); 917 fcbc.argument = list->fsui_list;
918 run_with_save_calls(&fsui_callback,
919 &fcbc);
920 fcbc.method = &FSUI_stopSearch;
921 run_with_save_calls(&fsui_callback,
922 &fcbc);
923 }
918} 924}
919 925
920/** 926/**
@@ -932,11 +938,12 @@ void on_abortSearchButton_clicked_fs(GtkWidget * searchPage,
932 list = list->next; 938 list = list->next;
933 } 939 }
934 GE_ASSERT(ectx, list != NULL); 940 GE_ASSERT(ectx, list != NULL);
935 941 if (list->fsui_list != NULL) {
936 fcbc.method = &FSUI_abortSearch; 942 fcbc.method = &FSUI_abortSearch;
937 fcbc.argument = list->fsui_list; 943 fcbc.argument = list->fsui_list;
938 run_with_save_calls(&fsui_callback, 944 run_with_save_calls(&fsui_callback,
939 &fcbc); 945 &fcbc);
946 }
940} 947}
941 948
942static void stopSearch(GtkTreeModel * model, 949static void stopSearch(GtkTreeModel * model,
@@ -952,13 +959,18 @@ static void stopSearch(GtkTreeModel * model,
952 SEARCH_SUMMARY_INTERNAL, &s, 959 SEARCH_SUMMARY_INTERNAL, &s,
953 -1); 960 -1);
954 if (s != NULL) { 961 if (s != NULL) {
955 fcbc.method = &FSUI_abortSearch; 962 if (s->fsui_list == NULL) {
956 fcbc.argument = s->fsui_list; 963 /* open directory - close directly */
957 run_with_save_calls(&fsui_callback, 964 fs_search_stopped(s);
958 &fcbc); 965 } else {
959 fcbc.method = &FSUI_stopSearch; 966 fcbc.method = &FSUI_abortSearch;
960 run_with_save_calls(&fsui_callback, 967 fcbc.argument = s->fsui_list;
961 &fcbc); 968 run_with_save_calls(&fsui_callback,
969 &fcbc);
970 fcbc.method = &FSUI_stopSearch;
971 run_with_save_calls(&fsui_callback,
972 &fcbc);
973 }
962 } 974 }
963} 975}
964 976
@@ -988,7 +1000,8 @@ static void abortSearch(GtkTreeModel * model,
988 iter, 1000 iter,
989 SEARCH_SUMMARY_INTERNAL, &s, 1001 SEARCH_SUMMARY_INTERNAL, &s,
990 -1); 1002 -1);
991 if (s != NULL) { 1003 if ( (s != NULL) &&
1004 (s->fsui_list != NULL) ) {
992 fcbc.method = &FSUI_abortSearch; 1005 fcbc.method = &FSUI_abortSearch;
993 fcbc.argument = s->fsui_list; 1006 fcbc.argument = s->fsui_list;
994 run_with_save_calls(&fsui_callback, 1007 run_with_save_calls(&fsui_callback,