aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: post-2.0: exclude existing search results  (Read 3791 times)

nachbarnebenan

  • Jr. Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 75
post-2.0: exclude existing search results
« 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.
Logged

skolnick

  • Global Moderator
  • Hero Member
  • *****
  • Karma: 24
  • Offline Offline
  • Posts: 1188
  • CentOS 6 User
Re: post-2.0: exclude existing search results
« Reply #1 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.
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: post-2.0: exclude existing search results
« Reply #2 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.
Logged

Xaignar

  • Admin and Code Junky
  • Hero Member
  • *****
  • Karma: 19
  • Offline Offline
  • Posts: 1103
Re: post-2.0: exclude existing search results
« Reply #3 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.
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: post-2.0: exclude existing search results
« Reply #4 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.
Logged

lfroen

  • Guest
Re: post-2.0: exclude existing search results
« Reply #5 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.
Logged

Xaignar

  • Admin and Code Junky
  • Hero Member
  • *****
  • Karma: 19
  • Offline Offline
  • Posts: 1103
Re: post-2.0: exclude existing search results
« Reply #6 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.
Logged

Xaignar

  • Admin and Code Junky
  • Hero Member
  • *****
  • Karma: 19
  • Offline Offline
  • Posts: 1103
Re: post-2.0: exclude existing search results
« Reply #7 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.
Logged