Commit c8a38d05 authored by Darin Adler's avatar Darin Adler

Require newer versions of various libraries to cut down on the bug reports

	* configure.in: Require newer versions of various libraries to
	cut down on the bug reports with people using newer nautilus
	and older versions of those libraries. Including bonobo 1.0.9,
	eel 1.0.2, librsvg 1.0.1. Remove the freetype stuff here, since
	that's all taken care of in librsvg. Remove old GNOME2_PATH thing
	that is definitely not needed. Remove gnome_canvas_set_dither
	check which is now in eel if needed at all. Remove ammonite
	configure flags.

	* nautilus.spec.in: Remove freetype dependencies. This is now
	handled in librsvg.

	* components/mozilla/Makefile.am:
	* components/mozilla/main.c: (main):
	* components/mozilla/nautilus-mozilla-content-view.c:
	(mozilla_location_callback), (mozilla_link_message_callback),
	(mozilla_dom_mouse_click_callback),
	(navigate_mozilla_to_nautilus_uri), (post_widget_initialize):
	* src/Makefile.am:
	Remove dependencies on ammonite and some more remnants of
	Eazel services code.
parent 9d48f0e9
2001-10-09 Darin Adler <darin@bentspoon.com>
* configure.in: Require newer versions of various libraries to
cut down on the bug reports with people using newer nautilus
and older versions of those libraries. Including bonobo 1.0.9,
eel 1.0.2, librsvg 1.0.1. Remove the freetype stuff here, since
that's all taken care of in librsvg. Remove old GNOME2_PATH thing
that is definitely not needed. Remove gnome_canvas_set_dither
check which is now in eel if needed at all. Remove ammonite
configure flags.
* nautilus.spec.in: Remove freetype dependencies. This is now
handled in librsvg.
* components/mozilla/Makefile.am:
* components/mozilla/main.c: (main):
* components/mozilla/nautilus-mozilla-content-view.c:
(mozilla_location_callback), (mozilla_link_message_callback),
(mozilla_dom_mouse_click_callback),
(navigate_mozilla_to_nautilus_uri), (post_widget_initialize):
* src/Makefile.am:
Remove dependencies on ammonite and some more remnants of
Eazel services code.
2001-10-09 Darin Adler <darin@bentspoon.com> 2001-10-09 Darin Adler <darin@bentspoon.com>
* libnautilus-private/nautilus-find-icon-image.c: * libnautilus-private/nautilus-find-icon-image.c:
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#undef HAVE_LIBJPEG #undef HAVE_LIBJPEG
#undef HAVE_STPCPY #undef HAVE_STPCPY
#undef HAVE_LIBBZ2 #undef HAVE_LIBBZ2
#undef HAVE_AMMONITE
#undef HAVE_LIBFAM #undef HAVE_LIBFAM
#undef bzCompress #undef bzCompress
#undef bzCompressInit #undef bzCompressInit
......
...@@ -10,7 +10,6 @@ INCLUDES = \ ...@@ -10,7 +10,6 @@ INCLUDES = \
$(MOZILLA_PROFILES_CFLAGS) \ $(MOZILLA_PROFILES_CFLAGS) \
$(MOZILLA_COMPONENT_CFLAGS) \ $(MOZILLA_COMPONENT_CFLAGS) \
$(GCONF_CFLAGS) \ $(GCONF_CFLAGS) \
$(AMMONITE_CFLAGS) \
$(NAUTILUS_DEPENDENCY_CFLAGS) \ $(NAUTILUS_DEPENDENCY_CFLAGS) \
$(NULL) $(NULL)
...@@ -41,7 +40,6 @@ nautilus_mozilla_content_view_LDADD = \ ...@@ -41,7 +40,6 @@ nautilus_mozilla_content_view_LDADD = \
$(MOZILLA_COMPONENT_LDFLAGS) \ $(MOZILLA_COMPONENT_LDFLAGS) \
$(MOZILLA_COMPONENT_LIBS) \ $(MOZILLA_COMPONENT_LIBS) \
$(GCONF_LIBS) \ $(GCONF_LIBS) \
$(AMMONITE_LIBS) \
$(NAUTILUS_DEPENDENCY_LIBS) \ $(NAUTILUS_DEPENDENCY_LIBS) \
$(NULL) $(NULL)
......
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
#include <libgnomevfs/gnome-vfs-init.h> #include <libgnomevfs/gnome-vfs-init.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_AMMONITE
#include <libtrilobite/libammonite-gtk.h>
#endif
#define nopeDEBUG_mfleming 1 #define nopeDEBUG_mfleming 1
#ifdef DEBUG_mfleming #ifdef DEBUG_mfleming
...@@ -256,10 +252,6 @@ main (int argc, char *argv[]) ...@@ -256,10 +252,6 @@ main (int argc, char *argv[])
gnome_vfs_init (); gnome_vfs_init ();
#ifdef HAVE_AMMONITE
ammonite_init ((PortableServer_POA) bonobo_poa);
#endif
/* We want the XPCOM runtime to stick around longer than /* We want the XPCOM runtime to stick around longer than
* the lifetime of a gtkembedmoz widget. * the lifetime of a gtkembedmoz widget.
* The corresponding pop_startup is in mozilla_process_delayed_exit * The corresponding pop_startup is in mozilla_process_delayed_exit
......
...@@ -53,10 +53,6 @@ ...@@ -53,10 +53,6 @@
#include <libgnomevfs/gnome-vfs.h> #include <libgnomevfs/gnome-vfs.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_AMMONITE
#include <libtrilobite/libammonite-gtk.h>
#endif
#define nopeDEBUG_ramiro 1 #define nopeDEBUG_ramiro 1
#define nopeDEBUG_mfleming 1 #define nopeDEBUG_mfleming 1
#define nopeDEBUG_pepper 1 #define nopeDEBUG_pepper 1
...@@ -206,11 +202,6 @@ static void mozilla_chrome_title_callback (GtkMozEmbed ...@@ -206,11 +202,6 @@ static void mozilla_chrome_title_callback (GtkMozEmbed
/* Private NautilusMozillaContentView functions */ /* Private NautilusMozillaContentView functions */
static char * translate_uri_nautilus_to_mozilla (NautilusMozillaContentView *view,
const char *uri);
static char * translate_uri_mozilla_to_nautilus (NautilusMozillaContentView *view,
const char *uri);
#ifdef BUSY_CURSOR #ifdef BUSY_CURSOR
static void set_busy_cursor (NautilusMozillaContentView *view); static void set_busy_cursor (NautilusMozillaContentView *view);
static void clear_busy_cursor (NautilusMozillaContentView *view); static void clear_busy_cursor (NautilusMozillaContentView *view);
...@@ -246,19 +237,6 @@ static gint string_list_get_index_of_string (const char *string_list[], ...@@ -246,19 +237,6 @@ static gint string_list_get_index_of_string (const char *string_list[],
static void pre_widget_initialize (void); static void pre_widget_initialize (void);
static void post_widget_initialize (void); static void post_widget_initialize (void);
#ifdef HAVE_AMMONITE
/*
* URL scheme hack for the eazel-services: scheme
*/
static char * eazel_services_scheme_to_http (NautilusMozillaContentView *view,
const char *uri);
static char * eazel_services_scheme_from_http (NautilusMozillaContentView *view,
const char *uri);
#endif /* HAVE_AMMONITE */
/* BonoboControl callbacks */ /* BonoboControl callbacks */
static void bonobo_control_activate_callback (BonoboObject *control, gboolean state, gpointer callback_data); static void bonobo_control_activate_callback (BonoboObject *control, gboolean state, gpointer callback_data);
...@@ -978,7 +956,6 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -978,7 +956,6 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data)
{ {
NautilusMozillaContentView *view; NautilusMozillaContentView *view;
char *new_location; char *new_location;
char *new_location_translated;
DEBUG_MSG (("+%s\n", __FUNCTION__)); DEBUG_MSG (("+%s\n", __FUNCTION__));
...@@ -991,9 +968,7 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -991,9 +968,7 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data)
new_location = gtk_moz_embed_get_location (view->details->mozilla); new_location = gtk_moz_embed_get_location (view->details->mozilla);
new_location_translated = translate_uri_mozilla_to_nautilus (view, new_location); DEBUG_MSG (("=%s : current='%s' new='%s'\n", __FUNCTION__, view->details->uri, new_location));
DEBUG_MSG (("=%s : current='%s' new='%s'\n", __FUNCTION__, view->details->uri, new_location_translated));
/* /*
* FIXME bug 7114 * FIXME bug 7114
...@@ -1015,19 +990,19 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -1015,19 +990,19 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data)
*/ */
if (view->details->uri == NULL if (view->details->uri == NULL
|| (!uris_identical (new_location_translated, view->details->uri))) { || (!uris_identical (new_location, view->details->uri))) {
if (view->details->user_initiated_navigation) { if (view->details->user_initiated_navigation) {
update_nautilus_uri (view, new_location_translated); update_nautilus_uri (view, new_location);
} else { } else {
DEBUG_MSG (("=%s : Navigation not user initiated, reporting as redirect\n", __FUNCTION__)); DEBUG_MSG (("=%s : Navigation not user initiated, reporting as redirect\n", __FUNCTION__));
DEBUG_MSG ((">nautilus_view_report_redirect (%s,%s)\n", view->details->uri, new_location_translated)); DEBUG_MSG ((">nautilus_view_report_redirect (%s,%s)\n", view->details->uri, new_location));
nautilus_view_report_redirect (view->details->nautilus_view, nautilus_view_report_redirect (view->details->nautilus_view,
view->details->uri, new_location_translated, NULL, new_location_translated); view->details->uri, new_location, NULL, new_location);
g_free (view->details->uri); g_free (view->details->uri);
view->details->uri = g_strdup (new_location_translated); view->details->uri = g_strdup (new_location);
} }
} else { } else {
DEBUG_MSG (("=%s : URI's identical, ignoring request\n", __FUNCTION__)); DEBUG_MSG (("=%s : URI's identical, ignoring request\n", __FUNCTION__));
...@@ -1035,12 +1010,7 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -1035,12 +1010,7 @@ mozilla_location_callback (GtkMozEmbed *mozilla, gpointer user_data)
view->details->user_initiated_navigation = FALSE; view->details->user_initiated_navigation = FALSE;
g_free (new_location_translated);
new_location_translated = NULL;
g_free (new_location); g_free (new_location);
new_location = NULL;
DEBUG_MSG (("-%s\n", __FUNCTION__)); DEBUG_MSG (("-%s\n", __FUNCTION__));
} }
...@@ -1163,7 +1133,6 @@ mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -1163,7 +1133,6 @@ mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data)
{ {
NautilusMozillaContentView *view; NautilusMozillaContentView *view;
char *link_message; char *link_message;
char *translated_link_message;
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data); view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
...@@ -1179,13 +1148,9 @@ mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data) ...@@ -1179,13 +1148,9 @@ mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data)
* for fragments inside a document). * for fragments inside a document).
*/ */
/* This is actually not that efficient */ /* DEBUG_MSG (("=%s new link message '%s'\n", __FUNCTION__, link_message)); */
translated_link_message = translate_uri_mozilla_to_nautilus (view, link_message);
/* DEBUG_MSG (("=%s new link message '%s'\n", __FUNCTION__, translated_link_message)); */
nautilus_view_report_status (view->details->nautilus_view, translated_link_message); nautilus_view_report_status (view->details->nautilus_view, link_message);
g_free (translated_link_message);
g_free (link_message); g_free (link_message);
/* DEBUG_MSG (("-%s\n", __FUNCTION__)) */ /* DEBUG_MSG (("-%s\n", __FUNCTION__)) */
...@@ -1261,12 +1226,10 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla, ...@@ -1261,12 +1226,10 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla,
NautilusMozillaContentView *view; NautilusMozillaContentView *view;
char *href; char *href;
char *href_full; char *href_full;
char *href_mozilla;
gint ret; gint ret;
href = NULL; href = NULL;
href_full = NULL; href_full = NULL;
href_mozilla = NULL;
ret = NS_DOM_EVENT_IGNORED; ret = NS_DOM_EVENT_IGNORED;
g_return_val_if_fail (GTK_IS_MOZ_EMBED (mozilla), NS_DOM_EVENT_IGNORED); g_return_val_if_fail (GTK_IS_MOZ_EMBED (mozilla), NS_DOM_EVENT_IGNORED);
...@@ -1287,56 +1250,11 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla, ...@@ -1287,56 +1250,11 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla,
if (href != NULL) { if (href != NULL) {
/*
* What's up with these translations?
* mozilla_to_nautilus translates http://localhost:160xx -> eazel-services:///
* nautilus_to_mozilla translates eazel--services -> http://localhost:160xx
*
* Case 0)
* "href" is a full normal HTTP uri
* href_full is identical to href
* Both the mozilla and nautilus versions of the href are identical
* We let the navigate continue w/o interrupting
*
* Case 1)
* "href" is a partial URI inside a normal HTTP page
* href_full is the full version of the uri
* Like in case 0,
* Both the mozilla and nautilus versions of the href are identical
* We let the navigate continue w/o interrupting
*
* Case 2)
* "href" is a relative link inside an eazel-services page
* href_full is "eazel-services:///<whatever>"
* href_mozilla is "http://localhost:160xx/<whatever>"
* We let the navigate continue w/o interrupting
*
* Case 3)
* "href" is a full eazel-services: URI
* href_full is "eazel-services:///<whatever>"
* href_mozilla is "http://localhost:160xx/<whatever>"
* We need to interrupt the navigate to translate. It's the
* same case as case (2) in the if statement below
*
* It's not actually feasible to get an http://localhost:160xx
* as href_full here, so we don't handle the case where
* href_full needs to be converted to a "nautilus" URI
*/
href_full = make_full_uri_from_relative (view->details->uri, href); href_full = make_full_uri_from_relative (view->details->uri, href);
href_mozilla = translate_uri_nautilus_to_mozilla (view, href_full);
DEBUG_MSG (("=%s href='%s' full='%s' xlate='%s'\n", __FUNCTION__, href, href_full, href_mozilla)); DEBUG_MSG (("=%s href='%s' full='%s'\n", __FUNCTION__, href, href_full));
if (href_mozilla == NULL) { if (href[0] == '#') {
/* An eazel-services URL when the user isn't logged in.
* Right now, we report a load error. But we
* could tell ammonite to prompt for login
*/
DEBUG_MSG ((">nautilus_view_report_load_failed\n"));
nautilus_view_report_load_failed (view->details->nautilus_view);
ret = NS_DOM_EVENT_CONSUMED;
} else if (href[0] == '#') {
/* a navigation to an anchor within the same page */ /* a navigation to an anchor within the same page */
view->details->user_initiated_navigation = TRUE; view->details->user_initiated_navigation = TRUE;
...@@ -1366,8 +1284,7 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla, ...@@ -1366,8 +1284,7 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla,
} else if (should_uri_navigate_bypass_nautilus (href_full)) { } else if (should_uri_navigate_bypass_nautilus (href_full)) {
view->details->user_initiated_navigation = TRUE; view->details->user_initiated_navigation = TRUE;
if ((should_mozilla_load_uri_directly (href_full) if (should_mozilla_load_uri_directly (href_full)
&& 0 == strcmp (href_full, href_mozilla))
|| is_uri_relative (href)) { || is_uri_relative (href)) {
/* If the URI doesn't need to be translated and we can load it directly, /* If the URI doesn't need to be translated and we can load it directly,
* then just keep going...report_location_change will happen in the * then just keep going...report_location_change will happen in the
...@@ -1399,7 +1316,6 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla, ...@@ -1399,7 +1316,6 @@ mozilla_dom_mouse_click_callback (GtkMozEmbed *mozilla,
DEBUG_MSG (("=%s no href, ignoring\n", __FUNCTION__)); DEBUG_MSG (("=%s no href, ignoring\n", __FUNCTION__));
} }
g_free (href_mozilla);
g_free (href_full); g_free (href_full);
g_free (href); g_free (href);
...@@ -1484,53 +1400,6 @@ vfs_read_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, gpointer ...@@ -1484,53 +1400,6 @@ vfs_read_callback (GnomeVFSAsyncHandle *handle, GnomeVFSResult result, gpointer
/***********************************************************************************/ /***********************************************************************************/
/***********************************************************************************/ /***********************************************************************************/
/*
* FIXME
* Both of these calls can make outbound CORBA calls which
* can allow incoming CORBA calls that can cause things to bust
*/
/*
* FIXME
* Right now, if you're on a normal HTML page and you encounter a link
* to eazel-services:///<something>, you'll get a failure from Mozilla instead
* of a login prompt. Login prompting needs to be added to Mozilla like
* the eazel-install view
*/
/* A NULL return from this function must trigger a nautilus load error */
static char *
translate_uri_nautilus_to_mozilla (NautilusMozillaContentView *view, const char *uri)
{
/* gint i; */
char *ret;
g_return_val_if_fail (uri != NULL, NULL);
#ifdef HAVE_AMMONITE
if (0 == strncmp (uri, "eazel-services:", strlen ("eazel-services:"))) {
ret = eazel_services_scheme_to_http (view, uri);
} else
#endif /* HAVE_AMMONITE */
{
ret = g_strdup (uri);
}
return ret;
}
static char *
translate_uri_mozilla_to_nautilus (NautilusMozillaContentView *view, const char *uri)
{
#ifdef HAVE_AMMONITE
return eazel_services_scheme_from_http (view, uri);
#else
return g_strdup (uri);
#endif /* HAVE_AMMONITE */
}
#ifdef BUSY_CURSOR #ifdef BUSY_CURSOR
static void static void
set_busy_cursor (NautilusMozillaContentView *view) set_busy_cursor (NautilusMozillaContentView *view)
...@@ -1577,23 +1446,13 @@ cancel_pending_vfs_operation (NautilusMozillaContentView *view) ...@@ -1577,23 +1446,13 @@ cancel_pending_vfs_operation (NautilusMozillaContentView *view)
/* this takes a "nautilus" uri, not a "mozilla" uri */ /* this takes a "nautilus" uri, not a "mozilla" uri */
static void static void
navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view, navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view,
const char *nautilus_uri) const char *uri)
{ {
char *mozilla_uri; char *old_uri;
char *old_mozilla_uri;
char *old_nautilus_uri;
mozilla_uri = translate_uri_nautilus_to_mozilla (view, nautilus_uri);
cancel_pending_vfs_operation (view); cancel_pending_vfs_operation (view);
if (mozilla_uri == NULL) {
DEBUG_MSG ((">nautilus_view_report_load_failed\n"));
nautilus_view_report_load_failed (view->details->nautilus_view);
goto error;
}
if (!GTK_WIDGET_REALIZED (view->details->mozilla)) { if (!GTK_WIDGET_REALIZED (view->details->mozilla)) {
/* Doing certain things to gtkmozembed before /* Doing certain things to gtkmozembed before
...@@ -1607,7 +1466,7 @@ navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view, ...@@ -1607,7 +1466,7 @@ navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view,
DEBUG_MSG (("=%s: Postponing navigation request to widget realization\n", __FUNCTION__)); DEBUG_MSG (("=%s: Postponing navigation request to widget realization\n", __FUNCTION__));
/* Note that view->details->uri is still set below */ /* Note that view->details->uri is still set below */
} else { } else {
if (should_mozilla_load_uri_directly (nautilus_uri)) { if (should_mozilla_load_uri_directly (uri)) {
/* See if the current URI is the same as what mozilla already /* See if the current URI is the same as what mozilla already
* has. If so, issue a reload rather than a load. * has. If so, issue a reload rather than a load.
...@@ -1617,36 +1476,27 @@ navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view, ...@@ -1617,36 +1476,27 @@ navigate_mozilla_to_nautilus_uri (NautilusMozillaContentView *view,
* locations) * locations)
*/ */
old_mozilla_uri = gtk_moz_embed_get_location (view->details->mozilla); old_uri = gtk_moz_embed_get_location (view->details->mozilla);
old_nautilus_uri = translate_uri_mozilla_to_nautilus (view, old_mozilla_uri);
if (old_nautilus_uri != NULL && uris_identical (nautilus_uri, old_nautilus_uri)) { if (old_uri != NULL && uris_identical (uri, old_uri)) {
DEBUG_MSG (("=%s uri's identical, telling mozilla to reload\n", __FUNCTION__)); DEBUG_MSG (("=%s uri's identical, telling mozilla to reload\n", __FUNCTION__));
gtk_moz_embed_reload (view->details->mozilla, gtk_moz_embed_reload (view->details->mozilla,
GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE); GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE);
} else { } else {
gtk_moz_embed_load_url (view->details->mozilla, gtk_moz_embed_load_url (view->details->mozilla, uri);
mozilla_uri);
} }
g_free (old_mozilla_uri); g_free (old_uri);
old_mozilla_uri = NULL;
g_free (old_nautilus_uri);
old_nautilus_uri = NULL;
} else { } else {
DEBUG_MSG (("=%s loading URI via gnome-vfs\n", __FUNCTION__)); DEBUG_MSG (("=%s loading URI via gnome-vfs\n", __FUNCTION__));
gnome_vfs_async_open (&(view->details->vfs_handle), nautilus_uri, GNOME_VFS_OPEN_READ, vfs_open_callback, view); gnome_vfs_async_open (&(view->details->vfs_handle), uri, GNOME_VFS_OPEN_READ, vfs_open_callback, view);
} }
} }
g_free (view->details->uri); g_free (view->details->uri);
view->details->uri = g_strdup (nautilus_uri); view->details->uri = g_strdup (uri);
DEBUG_MSG (("=%s current URI is now '%s'\n", __FUNCTION__, view->details->uri)); DEBUG_MSG (("=%s current URI is now '%s'\n", __FUNCTION__, view->details->uri));
error:
g_free (mozilla_uri);
mozilla_uri = NULL;
} }
static void static void
...@@ -2126,85 +1976,3 @@ post_widget_initialize (void) ...@@ -2126,85 +1976,3 @@ post_widget_initialize (void)
cache_dir = NULL; cache_dir = NULL;
} }
#ifdef HAVE_AMMONITE
/*
* URL scheme hack for the eazel-services: scheme
*/
/* A NULL return from this function must trigger a nautilus load error */
static char *
eazel_services_scheme_to_http (NautilusMozillaContentView *view,
const char *uri)
{
const char *uri_minus_scheme;
char *new_uri = NULL;
char *ret = NULL;
AmmoniteError err;
GnomeVFSURI *vfs_uri;
/* Chew off the the scheme, leave the colon */
uri_minus_scheme = strchr (uri, (unsigned char)':');
g_assert (uri_minus_scheme);
err = ammonite_http_url_for_eazel_url (uri_minus_scheme, &new_uri);
switch (err) {
case ERR_Success:
ret = g_strconcat ("http", new_uri, NULL);
g_free (new_uri);
new_uri = NULL;
break;
case ERR_UserNotLoggedIn:
/* Rather than try to use the ammonite login dialog directly here,
* we're going to coax the ammonite autoprompter to come
* up by using gnome-vfs
*/
vfs_uri = gnome_vfs_uri_new (uri);
if (vfs_uri != NULL) {
/* Don't remove: no-op to force ammonite login */
gnome_vfs_uri_is_local (vfs_uri);
gnome_vfs_uri_unref (vfs_uri);
vfs_uri = NULL;
}
err = ammonite_http_url_for_eazel_url (uri_minus_scheme, &new_uri);
if (err == ERR_Success) {
ret = g_strconcat ("http", new_uri, NULL);
g_free (new_uri);
new_uri = NULL;
} else {
ret = NULL;
}
break;
default:
ret = NULL;
break;
}
return ret;
}
static char *
eazel_services_scheme_from_http (NautilusMozillaContentView *view,
const char *uri)
{
AmmoniteError err;
char *ret;
err = ammonite_eazel_url_for_http_url (uri, &ret);
if (ERR_Success == err) {
DEBUG_MSG (("%s untranslated uri '%s' to '%s'\n", __FUNCTION__, uri, ret));
} else {
ret = g_strdup (uri);
}
return ret;
}
#endif /* HAVE_AMMONITE */
...@@ -7,11 +7,9 @@ dnl it too, or it will never make it into the spec file! ...@@ -7,11 +7,9 @@ dnl it too, or it will never make it into the spec file!
dnl