aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2004-06-03 23:01:33 +0800
committerDan Winship <danw@src.gnome.org>2004-06-03 23:01:33 +0800
commitb5d819b96d0cea2b8b76a1e231c0608899b21857 (patch)
tree4824e01cca7483cbde87756ebdaa0ee057c93d27
parent15d9e2645c17141ccfb33c59c0ad741962bd7843 (diff)
downloadgsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar.gz
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar.bz2
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar.lz
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar.xz
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.tar.zst
gsoc2013-evolution-b5d819b96d0cea2b8b76a1e231c0608899b21857.zip
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
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-icon-factory.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 33fe654c81..c79a9f5294 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-03 Dan Winship <danw@novell.com>
+
+ * 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
+
2004-06-01 Not Zed <NotZed@Ximian.com>
* e-fsutils.c (e_fsutils_avail): use statvfs if available. Should
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)