glocalfile: Fix G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE outside home

The G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE currently works only for locations
in the home directory. Let's make it work also for files outside the home
directory.
This commit is contained in:
Ondrej Holy 2020-06-15 17:14:30 +02:00
parent d067b5390a
commit 706dc6b5aa

View File

@ -112,6 +112,10 @@ G_DEFINE_TYPE_WITH_CODE (GLocalFile, g_local_file, G_TYPE_OBJECT,
static char *find_mountpoint_for (const char *file, dev_t dev, gboolean resolve_basename_symlink); static char *find_mountpoint_for (const char *file, dev_t dev, gboolean resolve_basename_symlink);
#ifndef G_OS_WIN32
static gboolean is_remote_fs (const gchar *filename);
#endif
static void static void
g_local_file_finalize (GObject *object) g_local_file_finalize (GObject *object)
{ {
@ -1111,11 +1115,13 @@ g_local_file_query_filesystem_info (GFile *file,
get_mount_info (info, local->filename, attribute_matcher); get_mount_info (info, local->filename, attribute_matcher);
#endif /* G_OS_WIN32 */ #endif /* G_OS_WIN32 */
} }
#ifndef G_OS_WIN32
if (g_file_attribute_matcher_matches (attribute_matcher, if (g_file_attribute_matcher_matches (attribute_matcher,
G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE)) G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE))
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE, g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE,
g_local_file_is_remote (local->filename)); is_remote_fs (local->filename));
#endif
g_file_attribute_matcher_unref (attribute_matcher); g_file_attribute_matcher_unref (attribute_matcher);