Bug 114293 - gnome_url_show() doesn't work using a URL that begins with "file://"
Summary: gnome_url_show() doesn't work using a URL that begins with "file://"
Status: RESOLVED INVALID
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Beta 3
Hardware: Other All
: P5 - None : Normal
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-31 00:03 UTC by Boyd Timothy
Modified: 2005-10-06 16:19 UTC (History)
1 user (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boyd Timothy 2005-08-31 00:03:14 UTC
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);
}
Comment 1 Boyd Timothy 2005-08-31 00:06:12 UTC
The error that is returned is:

There is no default action associated with this location.
Comment 2 JP Rosevear 2005-08-31 12:37:43 UTC
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?
Comment 3 Boyd Timothy 2005-08-31 14:11:22 UTC
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?
Comment 4 JP Rosevear 2005-08-31 15:01:58 UTC
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;
}
Comment 5 Boyd Timothy 2005-08-31 15:27:42 UTC
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.
Comment 6 JP Rosevear 2005-08-31 16:21:55 UTC
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?

Comment 7 Boyd Timothy 2005-08-31 16:27:21 UTC
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?
Comment 8 Boyd Timothy 2005-10-06 15:47:10 UTC
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.
Comment 9 Stanislav Brabec 2005-10-06 15:56:23 UTC
Can it be related with bug 118188?
Comment 10 Boyd Timothy 2005-10-06 16:19:25 UTC
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