From b5d819b96d0cea2b8b76a1e231c0608899b21857 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 3 Jun 2004 15:01:33 +0000 Subject: If the icon_name is an abolute path, just load it. * e-icon-factory.c (load_icon): If the icon_name is an abolute path, just load it. (e_icon_factory_get_icon): Update the docs to reflect that svn path=/trunk/; revision=26168 --- e-util/e-icon-factory.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'e-util/e-icon-factory.c') diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index aae04818d9..3c42d8fbad 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -91,7 +91,11 @@ load_icon (const char *icon_name, int size, int scale) GdkPixbuf *pixbuf, *unscaled = NULL; char *filename = NULL; - filename = gnome_icon_theme_lookup_icon (icon_theme, icon_name, size, NULL, NULL); + if (icon_name[0] == '/') + filename = g_strdup (icon_name); + else + filename = gnome_icon_theme_lookup_icon (icon_theme, icon_name, size, NULL, NULL); + if (!filename || !(unscaled = gdk_pixbuf_new_from_file (filename, NULL))) { if (scale) { struct dirent *dent; @@ -253,11 +257,12 @@ e_icon_factory_get_icon_filename (const char *icon_name, int icon_size) * @icon_size: size of the icon (one of the E_ICON_SIZE_* enum values) * * Returns the specified icon of the requested size (may perform - * scaling to achieve this) for the user's current icon theme. If the - * icon cannot be found, it falls back to loading the requested icon - * from Evolution's icon set installed from the art/ srcdir. If even - * that fails to find the requested icon, then a "broken-image" icon - * is returned. + * scaling to achieve this). If @icon_name is a full path, that file + * is used directly. Otherwise it is looked up in the user's current + * icon theme. If the icon cannot be found in the icon theme, it falls + * back to loading the requested icon from Evolution's icon set + * installed from the art/ srcdir. If even that fails to find the + * requested icon, then a "broken-image" icon is returned. **/ GdkPixbuf * e_icon_factory_get_icon (const char *icon_name, int icon_size) -- cgit v1.2.3