[Xfce4-commits] <midori:master> Fallback to file icon if no MIME icon is found
Christian Dywan
noreply at xfce.org
Tue Feb 15 01:00:01 CET 2011
Updating branch refs/heads/master
to b55ab3afa96379649d3a9a52ccdea51b9f14cf9f (commit)
from 5fd3c3b334692175f843f29526735301213f73be (commit)
commit b55ab3afa96379649d3a9a52ccdea51b9f14cf9f
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Feb 15 00:51:51 2011 +0100
Fallback to file icon if no MIME icon is found
midori/midori-view.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 34dee92..57efc83 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -2832,6 +2832,7 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view,
gchar* description;
#if GTK_CHECK_VERSION (2, 14, 0)
GIcon* icon;
+ GtkIconInfo* icon_info;
GtkWidget* image;
#endif
gchar* title;
@@ -2881,7 +2882,14 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view,
description = g_content_type_get_description (content_type);
#if GTK_CHECK_VERSION (2, 14, 0)
icon = g_content_type_get_icon (content_type);
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
+ icon_info = gtk_icon_theme_lookup_by_gicon (icon);
+ if (icon_info != NULL)
+ {
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);
+ gtk_icon_info_free (icon_info);
+ }
+ else
+ image = gtk_image_new_from_stock (GTK_STOCK_FILE, GTK_ICON_SIZE_DIALOG);
g_object_unref (icon);
gtk_widget_show (image);
gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
More information about the Xfce4-commits
mailing list