GNOME Bugzilla – Bug 708753
gdesktopappinfo: Call g_file_get_path() on demand
Last modified: 2013-09-27 07:53:40 UTC
Rather than always calling out to g_file_get_path() (which might block, whatever the documentation might say), postpone the call until we actually need it.
Created attachment 255690 [details] [review] gdesktopappinfo: Call g_file_get_path() on demand
Yeah, this is somewhat unfortunate in the gvfs implementation: static char * g_daemon_file_get_path (GFile *file) { GDaemonFile *daemon_file = G_DAEMON_FILE (file); GMountInfo *mount_info; const char *rel_path; char *path; /* This is a sync i/o call, which is a bit unfortunate, as * this is supposed to be a fast call. However, in almost all * cases this will be cached. */ mount_info = _g_daemon_vfs_get_mount_info_sync (daemon_file->mount_spec, daemon_file->path, NULL, /* TODO: cancellable */ NULL); This is needed to support the to-fuse path conversion. So, this will block the first time we're doing i/o on a particular mount for this thread. I don't really see how we could avoid this though, and returning the fuse path here is kind of important...
Review of attachment 255690 [details] [review]: Looks good to me. Safe and slightly better than before.
Attachment 255690 [details] pushed as 2d8e5ef - gdesktopappinfo: Call g_file_get_path() on demand