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 410113 - remove use of eel string truncation
remove use of eel string truncation
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
nautilus[EMC08]
: 409271 466762 (view as bug list)
Depends on:
Blocks: 409271
 
 
Reported: 2007-02-20 18:45 UTC by Christian Persch
Modified: 2018-02-07 08:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
partial patch (13.90 KB, patch)
2007-07-24 11:21 UTC, Christian Persch
committed Details | Review

Description Christian Persch 2007-02-20 18:45:17 UTC
eel_str_middle_truncate and eel_truncate_text_for_menu_item produce invalid UTF-8 (see bug 409271). Even if they were fixed to produce valid UTF-8, they'd still have the problem of truncating composing characters incorrectly etc. I think it's better to remove them completely and just let pango ellipsise the strings when they're displayed.
Comment 1 Christian Persch 2007-07-24 11:21:35 UTC
Created attachment 92266 [details] [review]
partial patch
Comment 2 Christian Persch 2007-07-24 15:22:55 UTC
        * libnautilus-private/nautilus-bookmark.c:
        (nautilus_bookmark_menu_item_new):
        * libnautilus-private/nautilus-customization-data.c:
        (nautilus_customization_data_new),
        (nautilus_customization_data_get_next_element_for_display):
        * libnautilus-private/nautilus-customization-data.h:
        * src/nautilus-application.c:
        * src/nautilus-bookmark-list.c: (new_bookmark_from_uri):
        * src/nautilus-navigation-window-menus.c: (connect_proxy_cb),
        (refresh_go_menu):
        * src/nautilus-places-sidebar.c: (bookmarks_drop_uris),
        (drag_data_received_callback):
        * src/nautilus-property-browser.c:
        (make_properties_from_directories):
        * src/nautilus-window-bookmarks.c: (connect_proxy_cb),
        (update_bookmarks):
        * src/nautilus-window-menus.c:
        (nautilus_menus_append_bookmark_to_menu):
        * test/test-nautilus-wrap-table.c: (main): Use pango ellipsisation
        instead of truncating the strings. Bug #410113.

Leaving open to eventually get rid of the rest of them too.
Comment 3 A. Walton 2008-05-07 20:45:39 UTC
I count zero uses of eel_truncate_text* remaining in Nautilus, so I'm closing this. Reopen if someone spots one grep/me missed.
Comment 4 Cosimo Cecchi 2008-08-03 10:24:47 UTC
Not fixed. We still use eel_str_middle_truncate in some places.
Comment 5 Emmanuel Fleury 2008-11-11 15:10:44 UTC
The title is a bit confusing... As far as I understand, solving this bug should be done by fixing eel_str_middle_truncate and eel_truncate_text_for_menu_item, not by removing the use of it.

Or did I miss something ?
Comment 6 Cosimo Cecchi 2011-09-22 04:39:54 UTC
*** Bug 466762 has been marked as a duplicate of this bug. ***
Comment 7 Cosimo Cecchi 2011-09-22 04:40:32 UTC
*** Bug 409271 has been marked as a duplicate of this bug. ***
Comment 8 William Jon McCann 2012-08-13 20:39:05 UTC
Looked into this a bit. I think there are some uses of the function that we can just avoid. They don't add much value. However, there are some that are used indirectly that are very difficult to avoid without major restructuring. For instance:
http://git.gnome.org/browse/nautilus/tree/libnautilus-private/nautilus-file-operations.c#n2930
(where %B is a middle truncated string)

Asked Owen for some advice and he said suggested it would be easiest to just fix eel_str_middle_truncate to use pango_get_log_attrs() and correct utf-8 operations - is_char_break isn't exactly right for places where you can cut the string to ellipsize, but close enough for practical purposes.
Comment 9 William Jon McCann 2012-08-13 21:25:55 UTC
Hmm, it seems that some of the issues were fixed during the gio port.
http://git.gnome.org/browse/eel/commit/eel/eel-string.c?id=59511dfee330102ee42e09bef37cbc9cd12973c6

Can someone please attach a use case that is still broken?
Comment 10 António Fernandes 2018-02-07 08:33:16 UTC
Bug 410113 listed ääääääääää as a broken case, but that's fixed and we have a test for that.

Since nobody mentioned a broken case for 4 years, I assume this is obsolete.