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 ...@@ -72,6 +72,11 @@ struct _GError
char *message; char *message;
}; };
typedef enum {
GNOME_VFS_OK
} GnomeVFSResult;
/* /*
* HACK: avoid error messages caused by not setting a GNOME program name * HACK: avoid error messages caused by not setting a GNOME program name
*/ */
...@@ -97,20 +102,28 @@ gchar* gnome_gconf_get_gnome_libs_settings_relative (const gchar *subkey) ...@@ -97,20 +102,28 @@ gchar* gnome_gconf_get_gnome_libs_settings_relative (const gchar *subkey)
gboolean gnome_url_show (const char *url, GError **error) 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 )
{
gboolean (* init) (void) =
(gboolean (*) (void)) dlsym(handle, "gnome_vfs_init");
if( NULL != handle) if( NULL != init && init() )
{ {
gboolean (* func) (const char *url, GError **error) = GnomeVFSResult (* func) (const char *url) =
(gboolean (*) (const char *, GError **)) dlsym(handle, "gnome_url_show"); (GnomeVFSResult (*) (const char *)) dlsym(handle, "gnome_vfs_url_show");
if( NULL != func ) if( NULL != func )
return func(url, error); ret = (GNOME_VFS_OK == func(url));
} }
return 0; dlclose(handle);
} }
return ret;
}
/* /*
* The intended use of this tool is to pass the argument to * The intended use of this tool is to pass the argument to
......
...@@ -49,6 +49,7 @@ case `uname -s` in ...@@ -49,6 +49,7 @@ case `uname -s` in
;; ;;
esac esac
"$0.bin" $1 & # use gnome-open utility coming with libgnome if available
gnome-open $1 2>/dev/null || "$0.bin" $1
exit 0 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