mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
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
This commit is contained in:
parent
1cd737653e
commit
3a26c3a61b
@ -54,6 +54,7 @@ extern "C" {
|
||||
#include <gtk/gtkimage.h>
|
||||
#include <gtk/gtkwindow.h>
|
||||
#include <gtk/gtkfixed.h>
|
||||
#include <gtk/gtkversion.h>
|
||||
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user