aMule Forum

English => Feature requests => Topic started by: nachbarnebenan on April 18, 2005, 12:14:25 PM

Title: post-2.0: exclude existing search results
Post by: nachbarnebenan on April 18, 2005, 12:14:25 PM
Well, should be an easy one, but getting 2.0 finished is more important. Search results, which are already in your shared or download list are colored green or red accordingly. This is very useful, but sometimes search list gets cluttered with them. So an easy on/off filter for these could be useful, especially when there are only a few results, you don't have already. The filter should only work on the already obtained results and not invoke a new search.
Title: Re: post-2.0: exclude existing search results
Post by: skolnick on April 18, 2005, 04:59:19 PM
Hi!

Not sure how useful is that...for me, it's easier to filter myself according to the result's color (red/green/black).

Regards.
Title: Re: post-2.0: exclude existing search results
Post by: ken on April 18, 2005, 10:23:48 PM
I suppose adding a column to indicate the "already download(ed/ing)" status and then letting the user sort by that column would accomplish the desired result.
Title: Re: post-2.0: exclude existing search results
Post by: Xaignar on April 18, 2005, 11:39:12 PM
That would be a PITA, since the results then wouldn't be sorted as one would want them to be. I've added a bug to the tracker about this. I'll probably add it together with reg.exp. filtering of the results.
Title: Re: post-2.0: exclude existing search results
Post by: ken on April 19, 2005, 12:43:53 PM
Xaignar, sorting is "stable".  If you sort by one criterion, and then sort by a second criterion, any elements which have the same value by the second criterion will remain sorted as they were by the first.  If that makes any sense.  ;)  Anyway, do it however you like.
Title: Re: post-2.0: exclude existing search results
Post by: lfroen on April 19, 2005, 04:00:07 PM
Quote
Xaignar, sorting is "stable".

No, it's not:

sorted by first field: a-9 b-9 c-1 d-2 e-2
now let's sort by second: c-1 d-2 e-2 a-9 b-9

You should explicitly define how and what exactly you sort.
Title: Re: post-2.0: exclude existing search results
Post by: Xaignar on April 19, 2005, 05:09:20 PM
IIRC, the listctrl sorting is stable. To get the desired result as ken suggested, all you have to do is use the same approach as radix-sorting, sorting the fields in reverse order. IE, first by desired column, then by "has file" column. This of course does require that the sorting is stable.

In this example, the second field is the "has file" field, the first being some arbitrary data field.

Original: 9-0 2-0 1-1 9-0 2-1 3-0
Sorted by first: 1-1 2-0 2-1 3-0 9-0 9-0
Sorted by second: 2-0 3-0 9-0 9-0 1-1 2-1

The actual order of the fields is of course only relevant when choosing the first column to sort by.
Title: Re: post-2.0: exclude existing search results
Post by: Xaignar on April 19, 2005, 05:17:59 PM
Looking through the wx sources it seems that the actual sorting is done via the qsort function, so it of course isn't stable.