|
Bugzilla – Full Text Bug Listing |
| Summary: | gnome_url_show() doesn't work using a URL that begins with "file://" | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Boyd Timothy <btimothy> |
| Component: | GNOME | Assignee: | E-mail List <gnome-bugs> |
| Status: | RESOLVED INVALID | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | sbrabec |
| Version: | Beta 3 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
The error that is returned is: There is no default action associated with this location. gnome-open is a command line tool for doing this. 'gnome-open file://` works fine for me. Can you give me the exact URL you are trying to open? The URL is: file:///opt/novell/ifolder3/share/ifolder3/help/en/doc/user/data/front.html When I run "gnome-open file:///opt/novell/ifolder3/share/ifolder3/help/en/doc/user/data/front.html" it works fine as well. The problem is calling Gnome.Url.Show() from C# or gnome_url_show() from C. Are you able to get the sample program above to work? gnome-open file:///usr/lib/ifolder3/share/ifolder3/help/en/doc/user/data/front.html
seems to work fine here (this is the location in SL 10.0 - is this what you are
running on?), opening in a browser. The source code for the gnome-open
utility is in libgnome and attached below:
#include <config.h>
#include <glib.h>
#include <stdio.h>
#include <libgnome/gnome-url.h>
#include <libgnome/gnome-program.h>
#include <libgnome/gnome-init.h>
#ifndef G_OS_WIN32
#include <libgnomevfs/gnome-vfs-utils.h>
#endif
#include "gnome-i18nP.h"
int
main (int argc, char *argv[])
{
GError *err = NULL;
char *uri;
if (argc < 2)
{
fprintf (stderr, "Usage: %s <url>\n", argv[0]);
return 1;
}
gnome_program_init ("gnome-url-show", VERSION,
LIBGNOME_MODULE,
argc, argv,
NULL);
#ifndef G_OS_WIN32
uri = gnome_vfs_make_uri_from_input_with_dirs (argv[1],
GNOME_VFS_MAKE_URI_DIR_CURRENT);
#else
if (g_path_is_absolute (argv[1]))
uri = g_filename_to_uri (argv[1], NULL, &err);
else
uri = g_filename_to_uri (g_build_filename (g_get_current_dir (), argv[1],
NULL), NULL, &err);
if (uri == NULL) {
fprintf (stderr, _("Error showing url: %s\n"), err->message);
g_error_free (err);
return 1;
}
#endif
if (gnome_url_show (uri, &err))
return 0;
fprintf (stderr, _("Error showing url: %s\n"), err->message);
g_error_free (err);
return 1;
}
I'm running openSUSE Beta 3. I just compiled and ran the code to gnome-open you included above and I get the following error message: Error showing url: There is no default action associated with this location. In comment #3 you said gnome-open worked fine for you though. I pulled the source code from CVS gnome 2.12 which is what we are shipping (2.11 development releases). I would say your mime database is messed up, but if it works as in #3 this is not the case. Is ifolder3 compiled from source or is it packages? The problem happens regardless of whether it's installed from source or from an RPMs. We've tried both. iFolder3 aside, shouldn't the gnome_show_url() work independently? I figured out that "gnome-open" works and that Gnome.Url.Show() works when compiled and run outside of iFolder. Something in the way that we're starting up iFolder (by setting MONO_PATH and LD_LIBRARY_PATH) is what's likely causing things not to work. We'll re-evaluate the problem later. However, this bug against SUSE Linux 10 is invalid since gnome_url_show() works in other programs. Can it be related with bug 118188? It could be. Our startup script (/opt/novell/ifolder3/bin/ifolder) is: export MONO_PATH=/opt/novell/ifolder3/lib:/opt/novell/ifolder3/web/bin:$MONO_PATH export LD_LIBRARY_PATH=/opt/novell/ifolder3/lib:/opt/novell/ifolder3/web/bin:$LD_LIBRARY_PATH cd /opt/novell/ifolder3/bin mono iFolderClient.exe |
This bug is preventing Help screens in iFolder 3 from functioning in the openSUSE distro. I'm using gtk-sharp from iFolder to launch our help (stored in an HTML file) using Gnome.Url.Show(). This eventually calls gnome_url_show(). After looking into this a little more, I noticed that if I write a standard C program that just calls this function, it's not able to launch URLs that start with "file://". If I use a URL that starts with "http://" it works like it should and launches the URL in Firefox. On NLD this launches the HTML file specified in my file:// URL in Firefox as well (which is what we expect it to do). Here is my sample code: #include <stdio.h> #include <libgnome/gnome-url.h> int main(int argc, char *argv[]) { GError *err; if (argc < 2) { printf("Usage: %s <url>\n", argv[0]); return -1; } printf("Opening %s\n", argv[1]); gnome_url_show(argv[1], &err); }