]> spindle.queued.net Git - midori/commitdiff
Clean up usage of pseudo-uris in special pages
authorPaweł Forysiuk <tuxator@o2.pl>
Tue, 9 Aug 2011 17:48:50 +0000 (19:48 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 15 Aug 2011 19:30:22 +0000 (21:30 +0200)
data/error.html
data/speeddial-head.html
midori/midori-view.c

index 56ca6032bf51a9bd725b90686a62784ee8a1ffd2..b8e70c6f1bd3626752b6be9eee02793045d3c52a 100644 (file)
@@ -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>
index 69844115858bb0c1784362f3146b2a8560980439..1b5cdf82ba477eee8a09fcfbbf8854940a4b3096 100644 (file)
@@ -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 {
         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;
 
     .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);
     }
index 1f9a9cef401e4fb91aa6b0e69b87f2ab5fdabbd5..367b4c2478d87d081d06f051c9a661f943e6519d 100644 (file)
@@ -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);
             }