libgnomevfs gnome_url_show api does'nt work on ubuntu

View: New views
2 Messages — Rating Filter:   Alert me  

libgnomevfs gnome_url_show api does'nt work on ubuntu

by Sharyathi Nagesh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi
   We are observing this problem while using gnome. This problem is
observed in Ubuntu 8.04 (Hardy Heron) as well as in sles11 RC1 x86_64.

Description:
  gnome_url_show api is supposed to open a file with an associated
application. When we change the associated application ,  this doesn't
open with the new application associated for the file , instead always
uses gedit.

How to reproduce:
In the GUI set preference for file testcase.txt to some thing other than
gedit and run this program
--------------------------------------------------------
#include <stdio.h>
#include <dlfcn.h>

typedef int gboolean;


gboolean (*gnome_url_show) (const char *url, void **error);

int main()
{

  void *gnome_handle;
  void *vfs_handle;
  gboolean (*gnome_vfs_init) (void);
  vfs_handle = dlopen("libgnomevfs-2.so.0", RTLD_LAZY);
  if(vfs_handle == NULL)
   {
      printf("\n cannot load libgnomevfs");
      return 0;
   }

  gnome_vfs_init = dlsym(vfs_handle, "gnome_vfs_init");

  if(gnome_vfs_init == NULL)
   {
     printf("\n gnome_vfs_init is NULL ");
     return 0;
   }
  (*gnome_vfs_init)();
  gnome_handle = dlopen("libgnome-2.so.0", RTLD_LAZY);
  if(gnome_handle == NULL)
   {
      printf("\n cannot load libgnome-2.so.0 ");
      return 0;
   }

  gnome_url_show = dlsym(gnome_handle, "gnome_url_show");
  if(gnome_url_show == NULL)
   {
     printf("\n gnome_url_show is null ");
     return 0;
   }

  gnome_url_show("file:/root/Desktop/testcase.txt",NULL);
  printf("\n AFter showing console");
  dlclose(gnome_handle);
  dlclose(vfs_handle);
  return 0 ;

}
--------------------------------------------------------
It still opens in gedit.

Can you please let us know your observation on how to get this
addressed. Or help us to direct the mail to the correct mailing list

Thanks
Sharyathi N




_______________________________________________
gnome-devel-list mailing list
gnome-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-devel-list

Re: libgnomevfs gnome_url_show api does'nt work on ubuntu

by Hubert Figuiere-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, 2009-01-13 at 15:49 +0530, Sharyathi Nagesh wrote:
> Description:
>   gnome_url_show api is supposed to open a file with an associated
> application. When we change the associated application ,  this
> doesn't
> open with the new application associated for the file , instead
> always
> uses gedit.


gnome_url_show is in libgnome which is DEPRECATED. So whatever bug
you'll find in unlikely to be fixed.

Use gtk_show_uri() from Gtk instead.


Hub

_______________________________________________
gnome-devel-list mailing list
gnome-devel-list@...
http://mail.gnome.org/mailman/listinfo/gnome-devel-list