After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 78865 - Bad result presentation
Bad result presentation
Status: VERIFIED FIXED
Product: gnome-utils
Classification: Deprecated
Component: gsearchtool
trunk
Other All
: Normal normal
: GNOME2.0
Assigned To: gnome-utils Maintainers
gnome-utils Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-04-16 16:40 UTC by Gaute Lindkvist
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The man page for locate on RedHat 7.2. (3.14 KB, text/plain)
2002-04-16 20:46 UTC, Dennis Cranston
  Details
The actual patch (5.14 KB, patch)
2002-04-19 14:57 UTC, Gaute Lindkvist
none Details | Review
The last patch was wrong! :P (85.91 KB, patch)
2002-04-19 15:09 UTC, Gaute Lindkvist
none Details | Review
Ny og oppdatert patch.. inkluderer også oppdatering for Nautilus OAFIID som postet på desktop-devel-list (3.92 KB, patch)
2002-04-26 09:56 UTC, Gaute Lindkvist
none Details | Review
Modified patch for CVS. (3.31 KB, patch)
2002-04-27 06:57 UTC, Dennis Cranston
none Details | Review

Description Gaute Lindkvist 2002-04-16 16:40:52 UTC
When searching for files with a simple pattern, the search will show all
files and subdirectories inside a directory if the directory itself matches
the pattern.
This gives you far too many results and makes it nearly impossible to
actually sort out the proper results.

The correct way will probably be to surpress all results that are found
ONLY due to the fact that its path contains the pattern.

If someone desperately wants to show all results, then I suggest a
collapsed tree. The search result is after all shown in the list view widget.
Comment 1 Kevin Vandersloot 2002-04-16 17:51:53 UTC
Probably won't happen. Locate doesn't provide an easy way to handle 
this.

Perhaps there is an advanced option to search for directories? I 
haven't checked yet and don't have access to the app right now.
Comment 2 Dennis Cranston 2002-04-16 20:46:29 UTC
Created attachment 7741 [details]
The man page for locate on RedHat 7.2.
Comment 3 John Fleck 2002-04-17 01:44:24 UTC
Could you be more specific about what it was in that man page that's
relevant?
Comment 4 Gaute Lindkvist 2002-04-19 01:17:24 UTC
I've posted a patch.. to desktop-devel-list that makes all files and
subdirectories under the actual match appear in a collapsed tree.

For instance, the regular result of locate and therefor gsearchtool is:

Searchword: cool

Results:
/home/whatever/cool/
/home/whatever/cool/README
/home/whatever/cool/floff
/home/whatever/cool/src
/home/whatever/cool/src/main.c
.........

This obviously creates WAY to many results. My patch makes it look
like this:

+ /home/whatever/cool


And you can click on the expand sign to get all the rather
uninteresting sub-results. The sub-results makes the dialog get so
many results that it is impossible to actually find the correct one.

Righy now however, I'm way too drunk to explain it properly. Good night :)
Comment 5 Kevin Vandersloot 2002-04-19 12:09:55 UTC
Gaute: could you attach the patch to this bug?
Comment 6 Gaute Lindkvist 2002-04-19 14:57:59 UTC
Created attachment 7815 [details] [review]
The actual patch
Comment 7 Gaute Lindkvist 2002-04-19 15:09:32 UTC
Created attachment 7817 [details] [review]
The last patch was wrong! :P
Comment 8 Kevin Vandersloot 2002-04-24 18:23:21 UTC
As specified in an email this patch should be redone without indent 
having been applied. 
Comment 9 Dennis Cranston 2002-04-24 20:30:28 UTC
I would like to add a comment on this patch.  I did apply it to my
local version of gnome-search-tool, and I have one problem.  When I
perform a simple search all the "correct" matches are not contained at
the root level.  

For example, I have these two folders /home/dcransto/mozilla and
/home/dcransto/mozilla/mozilla.  When I perform a search for "mozilla"
only the first folder is shown at the root level in the results.  The
second match is hidden under the first mozilla folder's node.  So, the
user will not be aware of the second match.

Thanks,
Dennis
Comment 10 Gaute Lindkvist 2002-04-24 21:08:14 UTC
Ok.. I'll redo the patch with no usage of indent and try to fix the
second problem (matches in the tree below the original match).

Does anyone have any idea on how this should look?

I think using my "tree-view" will probably be overly complex on second
thought. The locale-output will probably have to be parsed and sorted.

I'm in favour of not showing results that does not match more than
just their parent-dir.

Tbis means that searching for "cool" will yield:
/home/lindkvis/cool
/home/lindkvis/cool/smart/cool

And not:
/home/lindkvis/cool/README
(.. 50 other files ...) 
/home/lindkvis/smart
/home/lindkvis/cool/smart/cool
/home/lindkvis/cool/smart/ChangeLog
(.. 40 other files ...)
Comment 11 Gaute Lindkvist 2002-04-26 09:56:44 UTC
Created attachment 7973 [details] [review]
Ny og oppdatert patch.. inkluderer også oppdatering for Nautilus OAFIID som postet på desktop-devel-list
Comment 12 Gaute Lindkvist 2002-04-26 09:58:20 UTC
Uhhm.. somehow I posted the description of my last patch in Norwegian.

"Ny og oppdatert patch.. inkluderer også oppdatering for Nautilus
OAFIID som postet på desktop-devel-list"

Means:

"New and updated patch.. also includes update for Nautilus OAFIID like
posted on desktop-devel-list".

Sorry about that :)





        
Comment 13 Dennis Cranston 2002-04-26 16:23:13 UTC
Gaute-

A Nautilus OAFIID patch has already been checked in to CVS.  I will
try your patch this weekend.   Thanks!

-- Dennis
Comment 14 Dennis Cranston 2002-04-27 06:57:00 UTC
Created attachment 7983 [details] [review]
Modified patch for CVS.
Comment 15 Dennis Cranston 2002-04-27 07:03:07 UTC
I have modified Gaute's patch file to remove the redundant Nautilus
OAFIID changes.  I recommend applying the patch to CVS.  Gaute has
done some excellent work.  His changes will make the simple tab
results much more useful.  Thank you Gaute! 
Comment 16 Glynn Foster 2002-04-29 01:10:53 UTC
Hum, I haven't committed this yet because when I patched my source it
didn't seem to make a difference. Seems like a useful thing to have
for 2.0 with very little code involved.
Comment 17 Dennis Cranston 2002-04-29 03:30:29 UTC
Glynn -

If you are running this patch on a solaris box, you will not see any
changes in the results.  This change is for platforms (such as linux)
which have the locate command installed.  Hope this helps clear things
up for you.
Comment 18 Glynn Foster 2002-04-29 03:53:27 UTC
Nah, I'm running it on Debian PPC on my iBook. Will investigate tommorrow.
Comment 19 Gaute Lindkvist 2002-04-29 08:40:34 UTC
I use "basename" as a criteria for matching the search-pattern. I 
also use utf8-functions before pattern matching.. I only have an x86-
box, but I have trouble seeing what I did that shouldn't be portable. 
If you'd investigate this further, that would be great. Since I only 
used glib-functions, they should all be portable. At least none of 
the functions explicitely stated that they weren't portable.
Comment 20 Glynn Foster 2002-05-07 16:33:32 UTC
Oh, me bad. Sorry, I misread the bug report that said you were going
to do a treeview with +-
                   |-  

Have applied the patch in CVS as it seems like a good idea. Thanks for
the patch Gaute...and for the modifications Dennis :)