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 423272 - find/search doesn't normalize
find/search doesn't normalize
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks: 423036
 
 
Reported: 2007-03-27 08:51 UTC by Denis Jacquerye
Modified: 2007-03-27 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
normalization patch, v1 (2.56 KB, patch)
2007-03-27 13:19 UTC, Michael Chudobiak
none Details | Review
normalization patch, v2 (3.91 KB, patch)
2007-03-27 15:08 UTC, Michael Chudobiak
none Details | Review

Description Denis Jacquerye 2007-03-27 08:51:36 UTC
When searching for a file, comment, place or category precomposed characters are not found/search as their equivalent characters in Unicode.

Example: 
- a file has a comment with "école" that's with <U+00E9 LATIN SMALL LETTER E WITH ACUTE>.
- search for "école" with <U+0065 LATIN SMALL LETTER E  + U+0301 COMBINING ACUTE ACCENT>

The file is not found as a match when it should be.
Comment 1 Denis Jacquerye 2007-03-27 08:52:06 UTC
blocks meta bug 423036
Comment 2 Michael Chudobiak 2007-03-27 11:43:29 UTC
gThumb uses g_pattern_match_simple for searches. I think the normalization should happen in g_pattern_match_simple (glib) rather than gThumb. Do you agree?

- Mike
Comment 3 Denis Jacquerye 2007-03-27 12:46:37 UTC
(In reply to comment #2)
> gThumb uses g_pattern_match_simple for searches. I think the normalization
> should happen in g_pattern_match_simple (glib) rather than gThumb. Do you
> agree?

The lower the better. But we have to be careful that it doesn't break other things. 

For the moment, it would probably be enough to normalize the patterns when building the list of patterns and to normalize strings right before g_pattern_match_simple/g_pattern_match_string.
Comment 4 Michael Chudobiak 2007-03-27 13:19:17 UTC
Created attachment 85386 [details] [review]
normalization patch, v1

Denis,

Could you examine and test this patch against trunk?

It normalizes search strings and patterns, and it also normalizes returned dialog strings (thus handling new library / catalog names, part of bug 423271).

It doesn't address all your issues, but it is a start.

- Mike
Comment 5 Denis Jacquerye 2007-03-27 14:04:13 UTC
(In reply to comment #4)
> Created an attachment (id=85386) [edit]
That looks good to me.
- Created catalogs and libraries are normalized. 
- Creating equivalent names gives the same behaviour as creating bitwise identical name: no warning and nothing is created, this could be another bug ;-)
- Creating categories gives a warning as it should
- Searching works for comment, place and categories with either equivalent sequence

However searching filename is broken. In my test I have files "école.png" and "école.png". Searching for either gives no result. But that seem to have been broken before the patch.

btw: The file are incorrectly sorted. I have "école.png", "copy.png", "école.png" in that order. The e+combining diacritics is sorted at the very end.

Comment 6 Michael Chudobiak 2007-03-27 15:08:49 UTC
Created attachment 85392 [details] [review]
normalization patch, v2

Denis,

This revised patch fixes the sorting issue (thanks for catching that!). I'm not sure about the search issue yet.

- Mike
Comment 7 Michael Chudobiak 2007-03-27 15:52:28 UTC
OK, I have committed a patch that fixes the search issue to svn rev 1516.

Let me know if it doesn't work correctly...

- Mike
Comment 8 Denis Jacquerye 2007-03-27 16:33:49 UTC
Mike: Thank you, only the search filename issue remains.
Comment 9 Michael Chudobiak 2007-03-27 16:36:20 UTC
Did you try the latest svn version (not the patches here)? I thought the search function was working correctly now.

- Mike
Comment 10 Denis Jacquerye 2007-03-27 19:04:33 UTC
(In reply to comment #9)
> Did you try the latest svn version (not the patches here)? I thought the search
> function was working correctly now.
You're right, everything works for Search with the SVN version. My bad.

Thanks.