[Xfce4-commits] <midori:master> Introduce about:home as internal alias for the homepage

Christian Dywan noreply at xfce.org
Thu Mar 7 20:30:02 CET 2013


Updating branch refs/heads/master
         to ac7f3ad1aebdb0dc93954eacc2db93f73eeb4958 (commit)
       from 9bf44b4c1b8921e6d9a32ddf0d62201f09d8aad4 (commit)

commit ac7f3ad1aebdb0dc93954eacc2db93f73eeb4958
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Mar 7 20:20:15 2013 +0100

    Introduce about:home as internal alias for the homepage

 midori/midori-app.c     |    3 +--
 midori/midori-browser.c |    7 ++-----
 midori/midori-session.c |    2 +-
 midori/midori-view.c    |   11 +++++++----
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/midori/midori-app.c b/midori/midori-app.c
index 7289453..779c2ac 100644
--- a/midori/midori-app.c
+++ b/midori/midori-app.c
@@ -508,8 +508,7 @@ midori_app_command_received (MidoriApp*   app,
     {
         MidoriBrowser* browser = midori_app_create_browser (app);
         midori_app_add_browser (app, browser);
-        /* FIXME: Should open the homepage according to settings */
-        midori_browser_add_uri (browser, "");
+        midori_browser_add_uri (browser, "about:home");
         midori_browser_activate_action (browser, "Location");
         gtk_widget_show (GTK_WIDGET (browser));
         midori_app_raise_window (GTK_WINDOW (browser), screen);
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 5c79e4e..572a0a7 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3692,17 +3692,14 @@ _action_navigation_activate (GtkAction*     action,
     }
     else if (g_str_equal (name, "Homepage"))
     {
-        g_object_get (browser->settings, "homepage", &uri, NULL);
-
         if (middle_click)
         {
-            GtkWidget* view = midori_browser_add_uri (browser, uri);
+            GtkWidget* view = midori_browser_add_uri (browser, "about:home");
             midori_browser_set_current_tab_smartly (browser, view);
         }
         else
-            midori_view_set_uri (view, uri);
+            midori_view_set_uri (view, "about:home");
 
-        g_free (uri);
         return TRUE;
     }
 #endif
diff --git a/midori/midori-session.c b/midori/midori-session.c
index 67c81a9..1df69c5 100644
--- a/midori/midori-session.c
+++ b/midori/midori-session.c
@@ -484,7 +484,7 @@ midori_load_session (gpointer data)
         if (load_on_startup == MIDORI_STARTUP_BLANK_PAGE)
             katze_item_set_uri (item, "about:blank");
         else
-            item->uri = katze_object_get_string (settings, "homepage");
+            item->uri = g_strdup ("about:home");
         katze_array_add_item (saved_session, item);
         g_object_unref (item);
     }
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 3d71470..abe8e6a 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -3966,12 +3966,12 @@ list_video_formats (MidoriView* view)
 }
 
 static const gchar* valid_about_uris[] = {
-    "about:widgets",
-    "about:private",
-    "about:nodocs",
-    "http://.invalid",
     "about:geolocation",
+    "about:home",
+    "about:nodocs",
     "about:paths",
+    "about:private",
+    "about:widgets",
 };
 
 static void
@@ -4009,6 +4009,9 @@ midori_view_set_uri (MidoriView*  view,
 
     if (!midori_debug ("unarmed"))
     {
+        if (uri && !strcmp (uri, "about:home"))
+            uri = midori_settings_get_homepage (MIDORI_SETTINGS (view->settings));
+
         if (!uri || !strcmp (uri, "") || !strcmp (uri, "about:blank"))
         {
             MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));


More information about the Xfce4-commits mailing list