[Xfce4-commits] <midori:master> Ensure consistent fallback for no MIME type

Christian Dywan noreply at xfce.org
Sat Feb 11 04:58:01 CET 2012


Updating branch refs/heads/master
         to 8b766ca2a8b6df7b2dbcc03bdda27993fd26c0f6 (commit)
       from 50a4cda60c4fb801916981ccd54c6295167cf707 (commit)

commit 8b766ca2a8b6df7b2dbcc03bdda27993fd26c0f6
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Feb 11 04:55:36 2012 +0100

    Ensure consistent fallback for no MIME type

 midori/midori-view.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/midori/midori-view.c b/midori/midori-view.c
index 5befda6..ff593f5 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -493,7 +493,7 @@ midori_view_class_init (MidoriViewClass* class)
                                      "mime-type",
                                      "MIME Type",
                                      "The MIME type of the currently loaded page",
-                                     "text/html",
+                                     NULL,
                                      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
     g_object_class_install_property (gobject_class,
@@ -721,15 +721,13 @@ midori_view_unset_icon (MidoriView* view)
     if (!((screen = gtk_widget_get_screen (view->web_view))
         && (theme = gtk_icon_theme_get_for_screen (screen))))
         return;
-    if (view->mime_type == NULL)
-        return;
 
-    if (!((parts = g_strsplit (view->mime_type, "/", 2)) && (*parts && parts[1])))
+    if (!(view->mime_type
+       && (parts = g_strsplit (view->mime_type, "/", 2))
+       && (*parts && parts[1])))
     {
-        /* This is a hack to have a Find icon in the location while the
-           blank page has a File icon. */
-        icon = gtk_widget_render_icon (GTK_WIDGET (view),
-            GTK_STOCK_FIND, GTK_ICON_SIZE_MENU, NULL);
+        icon = gtk_widget_render_icon (view->web_view,
+            GTK_STOCK_FILE, GTK_ICON_SIZE_MENU, NULL);
         midori_view_apply_icon (view, icon, GTK_STOCK_FILE);
         goto free_parts;
     }
@@ -743,9 +741,9 @@ midori_view_unset_icon (MidoriView* view)
     if (midori_view_mime_icon (view, theme, "gnome-mime-%s-x-generic", *parts, NULL))
         goto free_parts;
 
-    icon = gtk_widget_render_icon (GTK_WIDGET (view),
+    icon = gtk_widget_render_icon (view->web_view,
         GTK_STOCK_FILE, GTK_ICON_SIZE_MENU, NULL);
-    midori_view_apply_icon (view, icon, NULL);
+    midori_view_apply_icon (view, icon, GTK_STOCK_FILE);
 
 free_parts:
     g_strfreev (parts);
@@ -3873,7 +3871,7 @@ midori_view_set_uri (MidoriView*  view,
             #endif
 
             katze_assign (view->uri, NULL);
-            katze_assign (view->mime_type, g_strdup ("text/html"));
+            katze_assign (view->mime_type, NULL);
             katze_item_set_meta_integer (view->item, "delay", -1);
 
             if (speeddial_markup == NULL)


More information about the Xfce4-commits mailing list