summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2023-01-30 07:50:46 +0100
committerOndrej Holy <oholy@redhat.com>2023-04-06 10:40:31 +0200
commitb024e24962e207095c6417b13b0f19f4aaa951d0 (patch)
tree4d04982ec0d3772bbac419f312f8119ec1ac4279
parentcd8cdc09308a363fb4e64d9f491c40fa58bf1806 (diff)
downloadnautilus-b024e24962e207095c6417b13b0f19f4aaa951d0.tar.gz
nautilus-file: Simplify nautilus_file_get_volume_name
The `nautilus_file_get_volume_name` function currently calls the `g_file_find_enclosing_mount` function, but this should not be needed as the enclosing mount is now part of the `NautilusFile` object.
-rw-r--r--src/nautilus-file.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index b48bf28e4..50bbe9e3b 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -7853,20 +7853,13 @@ nautilus_file_get_volume_free_space (NautilusFile *file)
char *
nautilus_file_get_volume_name (NautilusFile *file)
{
- GFile *location;
char *res;
- GMount *mount;
res = NULL;
-
- location = nautilus_file_get_location (file);
- mount = g_file_find_enclosing_mount (location, NULL, NULL);
- if (mount)
+ if (file->details->enclosing_mount)
{
- res = g_strdup (g_mount_get_name (mount));
- g_object_unref (mount);
+ res = g_strdup (g_mount_get_name (file->details->enclosing_mount));
}
- g_object_unref (location);
return res;
}