diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-09-01 10:24:12 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-09-01 10:24:12 +0000 |
commit | 974ad6ae24746c2b742df9ac5ab0865b2db548a4 (patch) | |
tree | 5914bcae7ee2c461191b2cab1252a77f239f0766 /test | |
parent | 80946aa5b99d26eab80d7ac90b7d4c38060ca2d0 (diff) | |
download | nautilus-974ad6ae24746c2b742df9ac5ab0865b2db548a4.tar.gz |
Strip extensions using eel_filename_strip_extension(). Fixes #309510.
2008-09-01 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-customization-data.c
(format_name_for_display), (load_name_map_hash_table):
* src/file-manager/fm-directory-view.c
(add_template_to_templates_menus):
* src/nautilus-property-browser.c
(nautilus_property_browser_drag_data_get),
(make_properties_from_directories):
* test/test-nautilus-wrap-table.c (main):
Strip extensions using eel_filename_strip_extension(). Fixes #309510.
Thanks to Paolo Borelli <pborelli@katamail.com> and Jared Moore
<jaredm@gmx.com>.
svn path=/trunk/; revision=14555
Diffstat (limited to 'test')
-rw-r--r-- | test/test-nautilus-wrap-table.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/test-nautilus-wrap-table.c b/test/test-nautilus-wrap-table.c index 258bde9a9..55147d2a9 100644 --- a/test/test-nautilus-wrap-table.c +++ b/test/test-nautilus-wrap-table.c @@ -2,6 +2,7 @@ #include <eel/eel-wrap-table.h> #include <eel/eel-labeled-image.h> +#include <eel/eel-vfs-extensions.h> #include <libnautilus-private/nautilus-customization-data.h> #include <libnautilus-private/nautilus-icon-info.h> @@ -11,7 +12,7 @@ main (int argc, char* argv[]) NautilusCustomizationData *customization_data; GtkWidget *window; GtkWidget *emblems_table, *button, *scroller; - char *emblem_name, *dot_pos; + char *emblem_name, *stripped_name; GdkPixbuf *pixbuf; char *label; @@ -62,19 +63,16 @@ main (int argc, char* argv[]) &pixbuf, &label) == GNOME_VFS_OK) { - /* strip the suffix, if any */ - dot_pos = strrchr(emblem_name, '.'); - if (dot_pos) { - *dot_pos = '\0'; - } + stripped_name = eel_filename_strip_extension (emblem_name); + g_free (emblem_name); - if (strcmp (emblem_name, "erase") == 0) { + if (strcmp (stripped_name, "erase") == 0) { g_object_unref (pixbuf); g_free (label); - g_free (emblem_name); + g_free (stripped_name); continue; } - + button = eel_labeled_image_check_button_new (label, pixbuf); g_free (label); g_object_unref (pixbuf); @@ -82,7 +80,7 @@ main (int argc, char* argv[]) /* Attach parameters and signal handler. */ g_object_set_data_full (G_OBJECT (button), "nautilus_property_name", - emblem_name, + stripped_name, (GDestroyNotify) g_free); gtk_container_add (GTK_CONTAINER (emblems_table), button); |