mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
glocalfile: Add SMB on the list of remote filesystems
The G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE is set to TRUE only for NFS filesystem types currently. Let's add also SMB filesystem types. This also changes g_local_file_is_nfs_home function logic to handle only NFS filesystems.
This commit is contained in:
parent
a8f97cbe8e
commit
92c9960521
@ -2532,6 +2532,12 @@ is_remote_fs_type (const gchar *fsname)
|
||||
return TRUE;
|
||||
if (strcmp (fsname, "nfs4") == 0)
|
||||
return TRUE;
|
||||
if (strcmp (fsname, "cifs") == 0)
|
||||
return TRUE;
|
||||
if (strcmp (fsname, "smb") == 0)
|
||||
return TRUE;
|
||||
if (strcmp (fsname, "smb2") == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@ -2540,7 +2546,7 @@ is_remote_fs_type (const gchar *fsname)
|
||||
gboolean
|
||||
g_local_file_is_nfs_home (const gchar *filename)
|
||||
{
|
||||
static gboolean remote_home;
|
||||
static gboolean remote_home = FALSE;
|
||||
static gsize initialized;
|
||||
const gchar *home;
|
||||
|
||||
@ -2557,7 +2563,8 @@ g_local_file_is_nfs_home (const gchar *filename)
|
||||
info = g_local_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, NULL, NULL);
|
||||
if (info != NULL)
|
||||
fs_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
|
||||
remote_home = is_remote_fs_type (fs_type);
|
||||
if (g_strcmp0 (fs_type, "nfs") == 0 || g_strcmp0 (fs_type, "nfs4") == 0)
|
||||
remote_home = TRUE;
|
||||
g_clear_object (&info);
|
||||
g_object_unref (file);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user