The URI of blank tabs is "", the title is "about:blank".

Something in the stack seems to magically turn
empty strings into about:blank, which is a problem
if we want to be able to start typing right away
when opening blank tabs.

We simply enforce the desired behaviour now.
This commit is contained in:
Christian Dywan 2008-10-07 22:30:09 +02:00
parent 63fc20b6f4
commit 9abfe87be9
2 changed files with 16 additions and 5 deletions

View file

@ -228,7 +228,7 @@ midori_browser_message_received_cb (UniqueApp* instance,
"history", app->history,
NULL);
/* FIXME: Should open the homepage according to settings */
midori_browser_add_uri (browser, "about:blank");
midori_browser_add_uri (browser, "");
midori_app_add_browser (app, browser);
gtk_window_set_screen (GTK_WINDOW (app->browser),
unique_message_data_get_screen (message));

View file

@ -2191,8 +2191,9 @@ midori_view_get_icon (MidoriView* view)
* midori_view_get_display_uri:
* @view: a #MidoriView
*
* Retrieves a string that is suitable for displaying,
* particularly an empty URI is represented as "about:blank".
* Retrieves a string that is suitable for displaying.
*
* Note that "about:blank" is represented as "".
*
* You can assume that the string is not %NULL.
*
@ -2201,11 +2202,16 @@ midori_view_get_icon (MidoriView* view)
const gchar*
midori_view_get_display_uri (MidoriView* view)
{
g_return_val_if_fail (MIDORI_IS_VIEW (view), "about:blank");
g_return_val_if_fail (MIDORI_IS_VIEW (view), "");
/* Something in the stack tends to turn "" into "about:blank".
Yet for practical purposes we prefer "". */
if (view->uri && !strcmp (view->uri, "about:blank"))
return "";
if (view->uri && *view->uri)
return view->uri;
return "about:blank";
return "";
}
/**
@ -2216,6 +2222,8 @@ midori_view_get_display_uri (MidoriView* view)
* as a title. Most of the time this will be the title
* or the current URI.
*
* An empty page is represented as "about:blank".
*
* You can assume that the string is not %NULL.
*
* Return value: a title string
@ -2225,6 +2233,9 @@ midori_view_get_display_title (MidoriView* view)
{
g_return_val_if_fail (MIDORI_IS_VIEW (view), "about:blank");
if (view->title && !strcmp (view->title, ""))
return "about:blank";
if (view->title && *view->title)
return view->title;
return midori_view_get_display_uri (view);