[Users] I need advice on making a recursive search

Steve Litt slitt at troubleshooters.com
Tue Mar 20 01:13:25 CET 2012


Hi all,

I'm evaluating whether I have the time and ability to add recursion to
the "Search Messages" facility normally popped up with the Ctrl+S
button. Because the code is written with a lot of callbacks
substituting for algorithm (it seems vaguely reminiscent of Model View
Controller on first look), I'm finding it somewhat tough going. Here's
what I've found so far:

summary_search.c
	static struct SummarySearchWindow
		Add GtkWidget *recursive_checkbtn
	static void summary_search_create(void)
		Declare/define 	GtkWidget *recursive_checkbtn;
		Run on recursive_checkbtn, similar to case_checkbtn:
			gtk_check_button_new_with_label(),
			gtk_widget_show() 
			gtk_box_pack_start()
		Maybe run either or both of these on recursive_checkbtn:
			SET_TOGGLE_SENSITIVITY_REVERSE()
			SET_TOGGLE_SENSITIVITY()
		search_window.recursive_checkbtn = recursive_checkbtn
	static void summary_search_execute(gboolean backward, 
				gboolean search_all)
		Declare/define gboolean recursive_search
		gtk_toggle_button_get_active() for recursive_search
		From function's bottom, find what code does the search
			Find a way to put that code in a loop


Putting the search code in a loop will be somewhat challenging because
the search is intermingled with user interface.

That leaves finding a folder recursion algorithm. I know the folder
properties dialog is contained in prefs_folder_item.c, but that appears
to be just user interface. Can anyone point me to a straightforward
folder recursion in the source code?

Thanks

SteveT







More information about the Users mailing list