From e5f50f83cd6351d9d75eca4098ce9e4d40a58d5c Mon Sep 17 00:00:00 2001 From: "marco%gnome.org" Date: Wed, 19 Jan 2005 20:01:27 +0000 Subject: [PATCH] 279015 Do not build icon theme lookup for gtk < 2.4, which does not support the icon name API. Fix the build with gtk < 2.4 Patch by marco@gnome.org r=cbiesinger git-svn-id: svn://10.0.0.236/trunk@168010 18797224-902f-48f8-a5cc-f745e15eee43 --- .../modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp b/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp index 2b3e74988d6..9f3db9860a1 100644 --- a/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp +++ b/mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp @@ -54,6 +54,7 @@ extern "C" { #include #include #include +#include #include "nsIMIMEService.h" @@ -128,7 +129,10 @@ moz_gdk_pixbuf_to_channel(GdkPixbuf* aPixbuf, nsIChannel **aChannel) static GtkWidget *gProtoWindow = nsnull; static GtkWidget *gStockImageWidget = nsnull; + +#if GTK_CHECK_VERSION(2,4,0) static GtkIconFactory *gIconFactory = nsnull; +#endif static void ensure_stock_image_widget() @@ -145,6 +149,7 @@ ensure_stock_image_widget() } } +#if GTK_CHECK_VERSION(2,4,0) static void ensure_icon_factory() { @@ -154,6 +159,7 @@ ensure_icon_factory() g_object_unref(gIconFactory); } } +#endif static GtkIconSize moz_gtk_icon_size(const char *name) @@ -347,6 +353,7 @@ nsIconChannel::Init(nsIURI* aURI) { GdkPixbuf *icon = gtk_widget_render_icon(gStockImageWidget, stockIcon.get(), icon_size, NULL); +#if GTK_CHECK_VERSION(2,4,0) if (!icon) { ensure_icon_factory(); @@ -362,6 +369,7 @@ nsIconChannel::Init(nsIURI* aURI) { icon = gtk_widget_render_icon(gStockImageWidget, stockIcon.get(), icon_size, NULL); } +#endif if (!icon) return NS_ERROR_NOT_AVAILABLE;