[Xfce4-commits] <midori:master> Clean up usage of pseudo-uris in special pages

Christian Dywan noreply at xfce.org
Mon Aug 15 21:32:03 CEST 2011


Updating branch refs/heads/master
         to c5151ff09ad0a88b8e9ed563a170e535082299dc (commit)
       from 32f71ef5e030af07972d4491d1f7b43deb4b3d57 (commit)

commit c5151ff09ad0a88b8e9ed563a170e535082299dc
Author: Paweł Forysiuk <tuxator at o2.pl>
Date:   Tue Aug 9 19:48:50 2011 +0200

    Clean up usage of pseudo-uris in special pages

 data/error.html          |    6 +++---
 data/speeddial-head.html |    6 +++---
 midori/midori-view.c     |   23 +++--------------------
 3 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/data/error.html b/data/error.html
index 56ca603..b8e70c6 100644
--- a/data/error.html
+++ b/data/error.html
@@ -62,15 +62,15 @@ description {
 </head>
 <body>
     <div id="container">
-        <img id="logo" src="{res}/logo-shade.png" />
-        <img id="icon" src="{stock}/gtk-dialog-error" />
+        <img id="logo" src="res://logo-shade.png" />
+        <img id="icon" src="stock://gtk-dialog-error" />
         <div id="main">
             <h1>{title}</h1>
             <p id="message">{message}</p>
             <p id="description">{description}</p>
             <form method="GET" action="{uri}">
                 <button type="submit" onclick="location.reload(); return false;">
-                    <img src="{stock}/gtk-refresh"/>
+                    <img src="stock://gtk-refresh"/>
                     <span>{tryagain}</span>
                 </button>
             </form>
diff --git a/data/speeddial-head.html b/data/speeddial-head.html
index 6984411..1b5cdf8 100644
--- a/data/speeddial-head.html
+++ b/data/speeddial-head.html
@@ -8,7 +8,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>{title}</title>
-    <script type="text/javascript" src="{res}/mootools.js"></script>
+    <script type="text/javascript" src="res://mootools.js"></script>
 
     <style>
     html, body, #content {
@@ -117,7 +117,7 @@
         width: 16px;
         margin-bottom: -17px;
         margin-top: 2px;
-        background: url({stock}/1/gtk-close) 98% 70% no-repeat;
+        background: url(stock://1/gtk-close) 98% 70% no-repeat;
         cursor: pointer;
         z-index: -4;
         opacity: 0.6;
@@ -129,7 +129,7 @@
 
     .activated p {
         cursor: text;
-        background: url({stock}/1/gtk-edit) 98% 70% no-repeat;
+        background: url(stock://1/gtk-edit) 98% 70% no-repeat;
         opacity: 0.6;
         color: rgba(0,0,0,1);
     }
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 1f9a9ce..367b4c2 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1418,22 +1418,15 @@ midori_view_display_error (MidoriView*     view,
     g_free (template_file);
     if (g_file_get_contents (path, &template, NULL, NULL))
     {
-        gchar* res_root;
-        gchar* stock_root;
         gchar* title_escaped;
         gchar* result;
 
-        res_root = g_strdup ("res:/");
-        stock_root = g_strdup ("stock:/");
-
         title_escaped = g_markup_escape_text (title, -1);
         result = sokoke_replace_variables (template,
             "{title}", title_escaped,
             "{message}", message,
             "{description}", description,
             "{tryagain}", try_again,
-            "{res}", res_root,
-            "{stock}", stock_root,
             "{uri}", uri,
             NULL);
         g_free (title_escaped);
@@ -1442,8 +1435,6 @@ midori_view_display_error (MidoriView*     view,
         midori_view_load_alternate_string (view,
             result, uri, web_frame);
 
-        g_free (res_root);
-        g_free (stock_root);
         g_free (result);
         g_free (path);
 
@@ -3683,8 +3674,6 @@ prepare_speed_dial_html (MidoriView* view)
      && g_file_get_contents (file_path, &speed_dial_head, NULL, NULL))
     {
         gchar* header = sokoke_replace_variables (speed_dial_head,
-            "{res}", "res:/",
-            "{stock}", "stock:/",
             "{title}", _("Speed Dial"),
             "{click_to_add}", _("Click to add a shortcut"),
             "{enter_shortcut_address}", _("Enter shortcut address"),
@@ -3883,18 +3872,13 @@ midori_view_set_uri (MidoriView*  view,
             if (!strncmp (uri, "error:nodocs ", 13))
             {
                 gchar* title;
-                gchar* logo_path;
-                gchar* logo_uri;
 
                 katze_assign (view->uri, g_strdup (&uri[13]));
                 title = g_strdup_printf (_("No documentation installed"));
-                logo_path = sokoke_find_data_filename ("midori/res/logo-shade.png");
-                logo_uri = g_filename_to_uri (logo_path, NULL, NULL);
-                g_free (logo_path);
                 data = g_strdup_printf (
                     "<html><head><title>%s</title></head>"
                     "<body><h1>%s</h1>"
-                    "<img src=\"%s\" "
+                    "<img src=\"res://logo-shade.png\" "
                     "style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
                     "<p />There is no documentation installed at %s. "
                     "You may want to ask your distribution or "
@@ -3902,9 +3886,8 @@ midori_view_set_uri (MidoriView*  view,
                     "verify that the build is setup properly. "
                     "<a href=\"http://wiki.xfce.org/midori/faq\">View the FAQ online</a>"
                     "</body></html>",
-                    title, title, logo_uri, view->uri);
+                    title, title, view->uri);
                 g_free (title);
-                g_free (logo_uri);
             }
             else if (!strcmp (uri, "about:") || !strcmp (uri, "about:version"))
             {
@@ -3989,7 +3972,7 @@ midori_view_set_uri (MidoriView*  view,
                 katze_assign (view->uri, g_strdup (uri));
                 data = g_strdup_printf (
                     "<html><head><title>%s</title></head><body><h1>%s</h1>"
-                    "<img src=\"file://" MDATADIR "/midori/res/logo-shade.png\" "
+                    "<img src=\"res://logo-shade.png\" "
                     "style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
                     "</body></html>", view->uri, view->uri);
             }


More information about the Xfce4-commits mailing list