summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-10-14 12:11:50 +0200
committerOndrej Holy <oholy@redhat.com>2016-11-10 09:35:21 +0100
commitc5cbb90566887528e07ccd6e8f05b63292b6ea71 (patch)
tree3f428901375f78fcb3dc162bd7809d1b801605df
parentc4a3a45234a056917359b8bc4d4f4a023f1bcb76 (diff)
downloadgvfs-c5cbb90566887528e07ccd6e8f05b63292b6ea71.tar.gz
udisks2: Add support for uuid
gvfs_udisks2_volume_get_uuid returns NULL regardless of the output from udisks_block_get_id_uuid currently. Set volume->uuid property and handle its changes properly. https://bugzilla.gnome.org/show_bug.cgi?id=772894
-rw-r--r--monitor/udisks2/gvfsudisks2volume.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c
index 0f912fe8..2469b8a7 100644
--- a/monitor/udisks2/gvfsudisks2volume.c
+++ b/monitor/udisks2/gvfsudisks2volume.c
@@ -237,6 +237,7 @@ update_volume (GVfsUDisks2Volume *volume)
gboolean old_should_automount;
gchar *old_name;
gchar *old_device_file;
+ gchar *old_uuid;
dev_t old_dev;
GIcon *old_icon;
UDisksDrive *udisks_drive;
@@ -251,6 +252,7 @@ update_volume (GVfsUDisks2Volume *volume)
old_should_automount = volume->should_automount;
old_name = g_strdup (volume->name);
old_device_file = g_strdup (volume->device_file);
+ old_uuid = g_strdup (volume->uuid);
old_dev = volume->dev;
old_icon = volume->icon != NULL ? g_object_ref (volume->icon) : NULL;
@@ -260,6 +262,7 @@ update_volume (GVfsUDisks2Volume *volume)
volume->can_mount = volume->should_automount = FALSE;
g_free (volume->name); volume->name = NULL;
g_free (volume->device_file); volume->device_file = NULL;
+ g_free (volume->uuid); volume->uuid = NULL;
volume->dev = 0;
g_clear_object (&volume->icon);
g_clear_object (&volume->symbolic_icon);
@@ -289,6 +292,7 @@ update_volume (GVfsUDisks2Volume *volume)
volume->dev = udisks_block_get_device_number (block);
volume->device_file = udisks_block_dup_device (block);
+ volume->uuid = udisks_block_dup_id_uuid (block);
if (strlen (udisks_block_get_id_label (block)) > 0)
{
@@ -562,6 +566,7 @@ update_volume (GVfsUDisks2Volume *volume)
(old_should_automount == volume->should_automount) &&
(g_strcmp0 (old_name, volume->name) == 0) &&
(g_strcmp0 (old_device_file, volume->device_file) == 0) &&
+ (g_strcmp0 (old_uuid, volume->uuid) == 0) &&
(old_dev == volume->dev) &&
g_icon_equal (old_icon, volume->icon)
);
@@ -571,6 +576,7 @@ update_volume (GVfsUDisks2Volume *volume)
g_free (old_name);
g_free (old_device_file);
+ g_free (old_uuid);
if (old_icon != NULL)
g_object_unref (old_icon);