Commit 0cc9cbd2 authored by Ramiro Estrugo's avatar Ramiro Estrugo
Browse files

Exorcist the moz:// hack.

* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_load_uri),
(mozilla_content_view_request_location_change):
Exorcist the moz:// hack.

* components/mozilla/nautilus-mozilla-content-view.oafinfo:
Change the protocol from moz to http.

* src/nautilus-applicable-views.c:
Prefer the mozilla component over the ntl-web-browser.
parent 18a80c69
2000-05-31 Ramiro Estrugo <ramiro@eazel.com>
* components/mozilla/nautilus-mozilla-content-view.c:
(nautilus_mozilla_content_view_load_uri),
(mozilla_content_view_request_location_change):
Exorcist the moz:// hack.
* components/mozilla/nautilus-mozilla-content-view.oafinfo:
Change the protocol from moz to http.
* src/nautilus-applicable-views.c:
Prefer the mozilla component over the ntl-web-browser.
2000-05-31 Ramiro Estrugo <ramiro@eazel.com>
* components/rpmview/nautilus-rpm-view.oafinfo:
......
......@@ -19,6 +19,7 @@
<oaf_attribute name="description" type="string" value="Mozilla content view component"/>
<oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
<item value="moz"/>
<item value="http"/>
</oaf_attribute>
<oaf_attribute name="nautilus:view_as_name" type="string" value="Web Page (Mozilla)"/>
......
......@@ -19,6 +19,7 @@
<oaf_attribute name="description" type="string" value="Mozilla content view component"/>
<oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
<item value="moz"/>
<item value="http"/>
</oaf_attribute>
<oaf_attribute name="nautilus:view_as_name" type="string" value="Web Page (Mozilla)"/>
......
......@@ -94,12 +94,6 @@ static void mozilla_content_view_request_progress_change (NautilusMozillaCont
gdouble progress_amount);
static void mozilla_content_view_request_location_change (NautilusMozillaContentView *view,
const char *new_location_uri);
static char *substitute_prefix (const char *uri,
const char *prefix,
const char *subsitite_prefix);
static char *mozilla_content_view_hack_uri (const char *uri);
static char *mozilla_content_view_unhack_uri (const char *uri);
static GtkVBoxClass *parent_class = NULL;
......@@ -234,7 +228,7 @@ nautilus_mozilla_content_view_load_uri (NautilusMozillaContentView *view,
g_free (view->details->uri);
}
view->details->uri = mozilla_content_view_unhack_uri (uri);
view->details->uri = g_strdup (uri);
#ifdef DEBUG_ramiro
g_print ("nautilus_mozilla_content_view_load_uri (%s)\n", view->details->uri);
......@@ -286,56 +280,17 @@ mozilla_content_view_request_location_change (NautilusMozillaContentView *view,
const char *new_uri)
{
Nautilus_NavigationRequestInfo navigation_request;
char *hacked_uri;
g_assert (view != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (view));
g_assert (new_uri != NULL);
memset (&navigation_request, 0, sizeof (navigation_request));
hacked_uri = mozilla_content_view_hack_uri (new_uri);
g_assert (hacked_uri);
navigation_request.requested_uri = hacked_uri;
navigation_request.requested_uri = (char *) new_uri;
nautilus_view_request_location_change (view->details->nautilus_view,
&navigation_request);
g_free (hacked_uri);
}
/* FIXME bugzilla.eazel.com 522: The http: -> moz: hack is temporary */
static char *
substitute_prefix (const char *uri, const char *prefix, const char *subsitite_prefix)
{
char *hacked_uri = NULL;
g_assert (uri != NULL);
if (uri
&& (strlen (uri) >= strlen (prefix))
&& (strncmp (uri, prefix, strlen (prefix)) == 0)) {
hacked_uri = g_strdup_printf ("%s%s", subsitite_prefix, uri + strlen (prefix));
}
else {
hacked_uri = g_strdup (uri);
}
return hacked_uri;
}
static char *
mozilla_content_view_hack_uri (const char *uri)
{
return substitute_prefix (uri, "http:", "moz:");
}
static char *
mozilla_content_view_unhack_uri (const char *uri)
{
return substitute_prefix (uri, "moz:", "http:");
}
static void
......
......@@ -19,6 +19,7 @@
<oaf_attribute name="description" type="string" value="Mozilla content view component"/>
<oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
<item value="moz"/>
<item value="http"/>
</oaf_attribute>
<oaf_attribute name="nautilus:view_as_name" type="string" value="Web Page (Mozilla)"/>
......
......@@ -171,7 +171,9 @@ set_initial_content_iid (NautilusNavigationInfo *navinfo,
static char * const nautilus_sort_criteria[] = {
/* Prefer the html view most */
/* Prefer the industrial strengthe html viewer most */
"iid == 'OAFIID:nautilus_mozilla_content_view:1ee70717-57bf-4079-aae5-922abdd576b1'",
/* Prefer the gtkhtml viewer next */
"iid == 'OAFIID:ntl_web_browser:0ce1a736-c939-4ac7-b12c-19d72bf1510b'",
/* Prefer the icon view next */
"iid == 'OAFIID:ntl_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058'",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment