Kaydet (Commit) 39cadccc authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS nautilus02 (1.2.90); FILE MERGED

2005/04/25 10:22:46 obr 1.2.90.1: #b6256546# use gnome-open where available and initialize gnome-vfs otherwise
üst 08fe2669
......@@ -72,6 +72,11 @@ struct _GError
char *message;
};
typedef enum {
GNOME_VFS_OK
} GnomeVFSResult;
/*
* HACK: avoid error messages caused by not setting a GNOME program name
*/
......@@ -97,21 +102,29 @@ gchar* gnome_gconf_get_gnome_libs_settings_relative (const gchar *subkey)
gboolean gnome_url_show (const char *url, GError **error)
{
void* handle = dlopen("libgnome-2.so.0", RTLD_LAZY);
void* handle = dlopen("libgnomevfs-2.so.0", RTLD_LAZY);
gboolean ret = 0;
if( NULL != handle)
if( NULL != handle )
{
gboolean (* func) (const char *url, GError **error) =
(gboolean (*) (const char *, GError **)) dlsym(handle, "gnome_url_show");
gboolean (* init) (void) =
(gboolean (*) (void)) dlsym(handle, "gnome_vfs_init");
if( NULL != func )
return func(url, error);
if( NULL != init && init() )
{
GnomeVFSResult (* func) (const char *url) =
(GnomeVFSResult (*) (const char *)) dlsym(handle, "gnome_vfs_url_show");
if( NULL != func )
ret = (GNOME_VFS_OK == func(url));
}
dlclose(handle);
}
return 0;
return ret;
}
/*
* The intended use of this tool is to pass the argument to
* the gnome_show_url function of libgnome2.
......
......@@ -49,6 +49,7 @@ case `uname -s` in
;;
esac
"$0.bin" $1 &
# use gnome-open utility coming with libgnome if available
gnome-open $1 2>/dev/null || "$0.bin" $1
exit 0
Markdown is supported
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