diff options
author | George Lebl <jirka@5z.com> | 2000-08-20 04:43:01 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2000-08-20 04:43:01 +0000 |
commit | 8b6aca1a6df97e4461f8dd85dc2b0ad3dd169bd9 (patch) | |
tree | e37cf9a91fbf86fcd9d02e0059b82248a5afab44 /src/nautilus-window-toolbars.c | |
parent | e576f941d2b9d17507b4818dece2151a240fc984 (diff) | |
download | nautilus-8b6aca1a6df97e4461f8dd85dc2b0ad3dd169bd9.tar.gz |
use xml memory allocation/deallocation routines for strings which are
Sat Aug 19 23:43:23 2000 George Lebl <jirka@5z.com>
* librsvg/rsvg.c (rsvg_ctx_free_helper) (rsvg_entity_decl):
use xml memory allocation/deallocation routines for strings
which are allocated/deallocated inside libxml to make glib
memory checking not crash
* libnautilus-extentions/nautilus-gnome-extentions.[ch]:
add a function nautilus_gnome_stock_set_icon_or_register which
does the GnomeStock voodoo for setting stock toolbar icons to
arbitrary files
* src/nautilus-window-toolbars.c (set_up_button): Use the
nautilus_gnome_stock_set_icon_or_register function as per Darin's
FIXME which thus got removed.
Diffstat (limited to 'src/nautilus-window-toolbars.c')
-rw-r--r-- | src/nautilus-window-toolbars.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/src/nautilus-window-toolbars.c b/src/nautilus-window-toolbars.c index 988d3c90a..d180516c2 100644 --- a/src/nautilus-window-toolbars.c +++ b/src/nautilus-window-toolbars.c @@ -36,6 +36,7 @@ #include <libnautilus-extensions/nautilus-bookmark.h> #include <libnautilus-extensions/nautilus-global-preferences.h> #include <libnautilus-extensions/nautilus-gtk-extensions.h> +#include <libnautilus-extensions/nautilus-gnome-extensions.h> #include <libnautilus-extensions/nautilus-theme.h> /* forward declarations */ @@ -285,14 +286,9 @@ set_up_button (GtkWidget* button, const char *theme_name, const char *icon_name) { - /* FIXME: This GnomeStock trickery belongs in the - * libnautilus-extensions library. That's where we put - * workarounds like this. - */ GnomeStock *stock_widget; char *full_name; GtkToolbarChild *toolbar_child; - GnomeStockPixmapEntryPath *new_entry; if (theme_name == NULL || strcmp (theme_name, "default") == 0) { full_name = g_strdup (icon_name); @@ -309,35 +305,11 @@ set_up_button (GtkWidget* button, stock_widget = NULL; } - if (stock_widget != NULL - && ! gnome_stock_set_icon (stock_widget, full_name) - && g_file_exists (full_name)) { - /* If full_name exists but gnome_stock_set_icon fails, - * that means this file has NOT been registered with - * gnome stock. Unfortunately gnome_stock is a - * worthless pile of dung and doesn't do this for us. - * Do note however that it DOES register this stuff - * when it first creates the toolbars from - * GnomeUIInfo. - */ - new_entry = g_malloc (sizeof (GnomeStockPixmapEntryPath)); - new_entry->type = GNOME_STOCK_PIXMAP_TYPE_PATH; - new_entry->label = NULL; - new_entry->pathname = full_name; - new_entry->width = 0; - new_entry->height = 0; - - /* Register this under the "full_name" as that's what - * we'll look it up under later. - */ - gnome_stock_pixmap_register (full_name, GNOME_STOCK_PIXMAP_REGULAR, - (GnomeStockPixmapEntry *) new_entry); - gnome_stock_set_icon (stock_widget, full_name); - - /* We used full_name in new_entry, so we just transfer - * ownership. - */ - full_name = NULL; + if (stock_widget != NULL) { + /* We can't just gnome_stock_set_icon here, as that + * doesn't register new pixmaps automatically */ + nautilus_gnome_stock_set_icon_or_register (stock_widget, + full_name); } g_free (full_name); |