After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 135629 - gnome-desktop-item.c misuses of gnome_vfs_uri_is_local()
gnome-desktop-item.c misuses of gnome_vfs_uri_is_local()
Status: RESOLVED FIXED
Product: gnome-desktop
Classification: Core
Component: libgnome-desktop
2.5.x
Other Linux
: Normal normal
: ---
Assigned To: Desktop Maintainers
Desktop Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-02-27 21:27 UTC by Dan Williams
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
patch (13.45 KB, patch)
2004-02-29 13:26 UTC, Mark McLoughlin
none Details | Review

Description Dan Williams 2004-02-27 21:27:39 UTC
There are a number of misuses of gnome_vfs_uri_is_local() in the
libgnome-desktop/gnome-desktop-item.c file.  These cause, for example,
gnome-panel launchers that use "%f" to fail to send the %f argument to the
launched application when the file is on an NFS mounted volume.

Normally, %f should send the file name (ie NOT a URL) to the launched
application.  %F _does_ indeed work, but %f fails when the directory that
the argument comes from (like ~/Desktop for homedirs) is network-mounted. 
The get_first_*() functions are guilty of this bug.

static char *
get_first_file (GSList **arg_ptr)
{
	while (*arg_ptr != NULL) {
		GnomeVFSURI *uri = (*arg_ptr)->data;
		if (gnome_vfs_uri_is_local (uri)) {
			char *path;
			path = g_strdup (gnome_vfs_uri_get_path (uri));
			return path;
		}
		*arg_ptr = (*arg_ptr)->next;
	}

	return NULL;
}

Here, since this function is called from the %f substitution block lower
down, the gnome_vfs_uri_is_local() skips over any object that is on a
network mount, as all objects in my homedir are.
Comment 1 Mark McLoughlin 2004-02-29 13:26:45 UTC
Created attachment 24931 [details] [review]
patch
Comment 2 Mark McLoughlin 2004-02-29 13:27:36 UTC
Dan, I've committed that patch to HEAD. If you have time, I'd
appreciate it if you could test it out with NFS dirs.