mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 08:23:38 +02:00
If possible, always pass FUSE file:// URIs (such as
2008-10-01 David Zeuthen <davidz@redhat.com> * gdesktopappinfo.c (expand_macro): If possible, always pass FUSE file:// URIs (such as '/home/davidz/.gvfs/sftp on foo/file.avi') instead of the gio URI (such as sftp://foo/file.avi) when using g_app_info_launch() and friends. With a sufficiently recent gvfs, apps using gio+gvfs will map the FUSE file:// URI back to the gio URI (and thus bypass the fuse daemon) thanks the patch from bug #530654. Since Nautilus is an user of g_app_info_launch() it means that non-gio POSIX apps, such as mplayer, will Just Work(tm) when launced via the file manager. Win. Fixes bug #528670. * gappinfo.c: Add some notes about the FUSE POSIX URI <-> GIO URI mapping to the description of GAppInfo. 2008-10-01 David Zeuthen <davidz@redhat.com> * README.in: Add "Notes about glib 2.20" section detailing the ramifications of the patch from bug #528670. svn path=/trunk/; revision=7566
This commit is contained in:
committed by
David Zeuthen
parent
ef4d522b9b
commit
04f0742818
@@ -530,9 +530,32 @@ expand_macro (char macro,
|
||||
{
|
||||
GList *uris = *uri_list;
|
||||
char *expanded;
|
||||
|
||||
gboolean force_file_uri;
|
||||
char force_file_uri_macro;
|
||||
|
||||
g_return_if_fail (exec != NULL);
|
||||
|
||||
|
||||
/* On %u and %U, pass POSIX file path pointing to the URI via
|
||||
* the FUSE mount in ~/.gvfs. Note that if the FUSE daemon isn't
|
||||
* running or the URI doesn't have a POSIX file path via FUSE
|
||||
* we'll just pass the URI.
|
||||
*/
|
||||
switch (macro)
|
||||
{
|
||||
case 'u':
|
||||
force_file_uri_macro = 'f';
|
||||
force_file_uri = TRUE;
|
||||
break;
|
||||
case 'U':
|
||||
force_file_uri_macro = 'F';
|
||||
force_file_uri = TRUE;
|
||||
break;
|
||||
default:
|
||||
force_file_uri_macro = macro;
|
||||
force_file_uri = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (macro)
|
||||
{
|
||||
case 'u':
|
||||
@@ -541,7 +564,17 @@ expand_macro (char macro,
|
||||
case 'n':
|
||||
if (uris)
|
||||
{
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
if (!force_file_uri)
|
||||
{
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
expanded = expand_macro_single (force_file_uri_macro, uris->data);
|
||||
if (expanded == NULL)
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
}
|
||||
|
||||
if (expanded)
|
||||
{
|
||||
g_string_append (exec, expanded);
|
||||
@@ -558,7 +591,17 @@ expand_macro (char macro,
|
||||
case 'N':
|
||||
while (uris)
|
||||
{
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
if (!force_file_uri)
|
||||
{
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
expanded = expand_macro_single (force_file_uri_macro, uris->data);
|
||||
if (expanded == NULL)
|
||||
expanded = expand_macro_single (macro, uris->data);
|
||||
}
|
||||
|
||||
if (expanded)
|
||||
{
|
||||
g_string_append (exec, expanded);
|
||||
|
Reference in New Issue
Block a user