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 82902 - Support for searching
Support for searching
Status: RESOLVED FIXED
Product: gconf-editor
Classification: Applications
Component: general
git master
Other All
: High enhancement
: ---
Assigned To: Gconf Editor Maintainers
Gconf Editor Maintainers
: 100465 105162 140007 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-05-24 17:01 UTC by Fernando Herrera
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch for searching (28.54 KB, patch)
2002-06-14 07:58 UTC, Fernando Herrera
none Details | Review
Patch updated to current CVS. (41.01 KB, patch)
2002-12-06 14:29 UTC, Fernando Herrera
none Details | Review
Patch updated to follow the HIG (29.20 KB, patch)
2002-12-08 15:22 UTC, Fernando Herrera
none Details | Review
Patch from Sujay SA and Varadharaj KP (24.17 KB, patch)
2004-04-14 12:58 UTC, Fernando Herrera
none Details | Review
Modified patch of patch #26651 (19.98 KB, patch)
2004-04-14 17:57 UTC, Sujay SA and Varadharaj KP
needs-work Details | Review
This is the reworked patch of #26660, the searching now takes care of keynames and values also (24.26 KB, patch)
2004-05-01 08:12 UTC, Sujay SA and Varadharaj KP
needs-work Details | Review
reworked patch of #27259 (31.55 KB, patch)
2004-05-11 15:10 UTC, Sujay SA and Varadharaj KP
none Details | Review

Description Fernando Herrera 2002-05-24 17:01:11 UTC
Hi, the next patch add support for searching in gconf-editor.
Currently it has implementes only search in the tree, but will be easy to
add search in key names and key values (already in the gui stuff).
Comment 1 Fernando Herrera 2002-06-14 07:57:49 UTC
Ups. I forget the patch. Here is it, with suppor for searching in
tree, key names and values. I think gtk2 treeview search feature is
not as flexible as gconf-editro need, and so this implementation,
Comment 2 Fernando Herrera 2002-06-14 07:58:31 UTC
Created attachment 9218 [details] [review]
Patch for searching
Comment 3 Fernando Herrera 2002-10-10 14:54:04 UTC
After bug #85778 discussion, search for unexpanded trees is not a good
feature for gtk2 widget. But I'm still thinking that search in
gconf-editor is extremadly useful. So we have two approach:
a) Add a menuitem/button to expand the whole tree and use the gtk_tree
search
b) Implement search inside gconf-editor for unexpanded trees.
Comment 4 Mark Finlay 2002-12-05 21:12:44 UTC
That patch no longer applies :(

It'd be really great to get searching in 
Comment 5 Fernando Herrera 2002-12-05 21:22:07 UTC
hummm, I supose that gconf-editor has changed a lot... if useful, I'll
update the patch against cvs HEAD
Comment 6 Mark Finlay 2002-12-05 21:39:24 UTC
Well the bug you linked to above will not get fixed, so if the patch
can be updated and it works well i'd like to push to get it committed.

May be impossible because of freezage though
Comment 7 Fernando Herrera 2002-12-06 14:29:25 UTC
Created attachment 12794 [details] [review]
Patch updated to current CVS.
Comment 8 Fernando Herrera 2002-12-06 14:31:15 UTC
I've have updated the patch. But it should need review, and the
tree_view scroll is not working properly, any gtk_tree_view guru?
Comment 9 Mark Finlay 2002-12-06 19:49:07 UTC
The search seems to work very well - but the dialog isn't very hig.

Maybe looking at the gedit find dialog or something like that might
be of help.
Comment 10 Fernando Herrera 2002-12-08 15:21:47 UTC
Ok. I have updated the dialog to look like the gedit one.
BTW, gtk_tree_view_scroll stuff is not working properly, and I would
like someone to review it, because is a bit old.

Another issue... does we want case insensitve search in gconf-editor?
Comment 11 Fernando Herrera 2002-12-08 15:22:48 UTC
Created attachment 12841 [details] [review]
Patch updated to follow the HIG
Comment 12 Mark McLoughlin 2002-12-18 01:55:14 UTC
*** Bug 100465 has been marked as a duplicate of this bug. ***
Comment 13 Mark McLoughlin 2002-12-18 01:56:22 UTC
Fernando: as soon as 2.4 development starts, pester Anders to get this
patch in.
Comment 14 Alex Duggan 2003-02-04 01:59:26 UTC
*** Bug 105162 has been marked as a duplicate of this bug. ***
Comment 15 Tomas Junnonen 2003-03-02 15:32:08 UTC
My fifteen minute mini-review of Fernando's work:

You should always code with all error reporting turned on in your
compiler. You've got missing declarations in header files, unused
values and pointer abuse. Similiarly you should follow the whitespace
and indentation style in gconf-editor and GNOME in general. Also that
Node struct looks really out of place.

On to more concrete things. Specifically having to search for a key,
value or "tree" is bothersome, usually you just want to find
something, anything, and you shouldn't have to do multiple searches to
get it. Instead of radiobuttons you should go with checkbuttons for
Keys and Values. "Tree" (nodes, I assume) is not something typical of
GConf's terminology, the only distinction is if the key has subkeys or
a value attached to it, something I seriously doubt anyone cares
about. So get rid of "tree" as a search option, key and values is enough.

It still doesn't follow the HIG. Having the menu option "Search"
attached to the accelerator Control-F should tip you off ;) To follow
the HIG the Search item should be removed from the "Edit" menu, a new
"Search" menu should be created with the items Find and Find Next.

I also found untranslated strings, "Pattern not found" springs to
mind. It's also no good as an error message, take a look at how gedit
does it. Also you shouldn't present an error (information is probably
the correct one) dialog when the search fails, again, look at gedit.

Well, that's just some things of the top of my mind. I'm interested in
this issue so I might fix these problems myself, if you don't beat me
to it :)
Comment 16 Fernando Herrera 2003-03-02 16:46:49 UTC
Thank you very much for your review Tomas. It was my first serious
GNOME coding, it was only I try. Feel free to hack on it (or rewrite
it :). I coded it as a proof of concept. I don't have time at this
very moment (after one month of holydays, I need to do lot of
university and Onirica work!).
Comment 17 Fernando Herrera 2004-04-14 12:57:35 UTC
*** Bug 140007 has been marked as a duplicate of this bug. ***
Comment 18 Fernando Herrera 2004-04-14 12:58:39 UTC
Created attachment 26651 [details] [review]
Patch from Sujay SA and Varadharaj KP
Comment 19 Fernando Herrera 2004-04-14 13:15:32 UTC
Some comments on your patch:

+       window->find_combo_items->data=NULL;

If you look at the GNOME source code, we usually do

var = value; (spaces between "=")

and

my_cool_function (parameter1, parameter2); (more spaces :)

Please, follow the coding style for the next patches

There are also some comments on the implementation, but the most importants are
over the functionality:
* It only looks for dirnames, it should look also for key names and key values.
* It also should look for partial matches (look at gedit, it defaults look for
partial matches and add a checkbox to search exact words).

so it needs more work, but you are on the right way! Good work. Please, feel
free to ask/comment anything!








Comment 20 Sujay SA and Varadharaj KP 2004-04-14 17:57:14 UTC
Created attachment 26660 [details] [review]
Modified patch of patch #26651

This patch also takes care of partial matches. As of now we think it may not be
useful to search key names and key values because, the key names keep repeating
in most of the directories. So, it is effective to go through the directory
name for searching.
Comment 21 Sebastian Kapfer 2004-04-14 21:56:38 UTC
Some key names keep repeating, yes. But it's still a very useful feature for
other, less common key names. The same is true for values.

Thanks anyway for doing something about this bug, it's a really important one IMHO.
Comment 22 Sujay SA and Varadharaj KP 2004-05-01 08:12:00 UTC
Created attachment 27259 [details] [review]
This is the reworked patch of #26660, the searching now takes care of keynames and values also

This patch, includes searching based on keynames, and keyvalues. Also, partial
matches can also be found on any of these - directory name, keyname or
keyvalue.
Neccessary option buttons are given to search the required item easily.
Comment 23 Fernando Herrera 2004-05-05 12:25:41 UTC
Comment on attachment 27259 [details] [review]
This is the reworked patch of #26660, the searching now takes care of keynames and values also

Some comments after apliying it:
* The find box is resized after it is showed.
* As a comment said before, maybe making Directories and key names a separate
option is not clear, because a directory is a part of the key so it should
matched when looking for keys.
* Looking for values is segfaulting right now (I'll try to look at the code
later)
* Searching and the repositioning the cursor is not working properly
* the go_to is also not working correctly (yep, I also love-hate GtkTreeView)
* You are searching in gconf data directly instead of the liststore, and just
now some additions/mofitications to the database are not correctly showed in
the tree view, so a search could find a result not presented in the tree view
(just now if a dir addition occurs where the parent is expanded, it is not
realized). But I'm working on fixing this so the liststore should be equal to
the gconf dir always.
Comment 24 Sujay SA and Varadharaj KP 2004-05-10 08:03:24 UTC
The segmentation fault that occur while searching a key value was because of the
insufficient memory when an exhaustive search is made. This can be overcome by
searching a part of the tree and continuing further to find a desired key.
For example /apps, /desktop, /system. by doing this the searching becomes faster
and also the memory required for searching is also minimized.
Searching and repositiong of the cursor is working properly, if not the fault
may be in the gtk_tree.
The corrections will be made and soon will be put up as a patch.
Comment 25 Sujay SA and Varadharaj KP 2004-05-11 15:10:38 UTC
Created attachment 27605 [details] [review]
reworked patch of #27259

Search for key name and key value do not cause segmantation fault now. Now key
names and key values can be searched under a selected directory recursively by
selecting a directory in the tree. Search for a key value under the directory
"/schemas" has been skipped because no key values are found in it.
Repositioning of the cursor in the tree view works fine after searching.
Comment 26 Fernando Herrera 2004-07-08 21:47:13 UTC
I've redone the search stuff, with a new fancy window showing results.
Thank you very much to all of you working on this!!!