[Xfce4-commits] <midori:master> Revisit favicon fix: insert <link if an icon is set

Christian Dywan noreply at xfce.org
Tue Feb 26 00:54:02 CET 2013


Updating branch refs/heads/master
         to 21d24359263b80d7db742410c71becd3891b7e96 (commit)
       from 39b8c1daa81a9b46618ba34e1744f15515e669be (commit)

commit 21d24359263b80d7db742410c71becd3891b7e96
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Feb 26 00:51:48 2013 +0100

    Revisit favicon fix: insert <link if an icon is set
    
    Otherwise "" will yield the tab URL itself.

 data/error.html      |    2 +-
 midori/midori-view.c |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/data/error.html b/data/error.html
index 575726b..8de2f75 100644
--- a/data/error.html
+++ b/data/error.html
@@ -5,7 +5,7 @@
 <html dir="{dir}">
 <head>
 <title>{title}</title>
-<link rel="shortcut icon" href="{icon}" />
+{favicon}
 <link rel="stylesheet" type="text/css" href="res://about.css" />
 </head>
 <body>
diff --git a/midori/midori-view.c b/midori/midori-view.c
index c36e9fa..e6c77fa 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1259,6 +1259,7 @@ midori_view_display_error (MidoriView*     view,
     {
         gchar* title_escaped;
         const gchar* icon;
+        gchar* favicon;
         gchar* result;
 
         #if !GTK_CHECK_VERSION (3, 0, 0)
@@ -1273,17 +1274,20 @@ midori_view_display_error (MidoriView*     view,
             uri = midori_tab_get_uri (MIDORI_TAB (view));
         title_escaped = g_markup_escape_text (title ? title : view->title, -1);
         icon = katze_item_get_icon (view->item);
+        favicon = icon && !g_str_has_prefix (icon, "stock://")
+          ? g_strdup_printf ("<link rel=\"shortcut icon\" href=\"%s\" />", icon) : NULL;
         result = sokoke_replace_variables (template,
             "{dir}", gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL ?
                 "rtl" : "ltr",
             "{title}", title_escaped,
-            "{icon}", icon && strcmp (&icon[8], "stock://") ? icon : "",
+            "{favicon}", katze_str_non_null (favicon),
             "{message}", message,
             "{description}", description,
             "{tryagain}", try_again,
             "{uri}", uri,
             "{hide-button-images}", show_button_images ? "" : "display:none",
             NULL);
+        g_free (favicon);
         g_free (title_escaped);
         g_free (template);
 


More information about the Xfce4-commits mailing list