Quoting Emile le Vivre <[EMAIL PROTECTED]> from ml.softs.gtk-gnutella.devel: :Basically I had to make a :special case in the sorting algorithms for sorting by "#" in a passive :search.
Are you sure this is needed ONLY for passive searches? :This is because once a passive search maxes out we are no :longer adding nodes to that tree but if the other searches aren't maxed :the count values can continue to be increased for the search results :(but the # column is not updated in the passive results tree). Then :when we sort by count in the passive search, it sorts by the real count :value for the regular search tree. The solution I chose was to just use :the text displayed in the column for passive searches instead of the :count value stored in the search result record. This is what the user :expects but involves a bunch of checks and ctree retrievals. Sorting is :slow enough as is so I didn't want to use this for all sorts by count, :only for passive searches. Hopefully there's not too many more "special :cases". Imagine a passive search opened AFTER an active search which has almost maxed-out. When query hits come back, they will be dispatched to both, and the counts in the passive search and those in the active search can become different. Shouldn't we ALWAYS sort by the '#' displayed in the GUI and forget about the value in the data structure? In my example above, the active search will max out BEFORE the passive one, and if many hits come back which update lots of parent nodes, then sorting by '#' in the active search could lead to wrong results. :Also, this raised an interesting question. Now that we've added child :nodes, should they count towards the "max search results" value? :Imagine someone has max search results set to 100, they search and they :get only 5 different results (with 20 sources each). Is this expected? :Or should it refer to 100 parent nodes instead? I don't think so. The purpose of the max_search_results value is to avoid an ever-growing memory usage. If you're not putting an upper-bound, then GTKG can consume all the RAM you have. Raphael ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gtk-gnutella-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel
