Commit c416368e authored by Michael Terry's avatar Michael Terry

BackendDrive: Fix setting a drive volume

Use get_uuid() instead of get_identifier(UUID) because it gets the
user-friendly version (i.e. the unencrypted partition, not the outer
LUKS partition).

And actually set the drive UUID when choosing it in the settings.

https://launchpad.net/bugs/1717230
parent d8b1c2b1
......@@ -426,8 +426,7 @@ public class ConfigLocation : ConfigWidget
{
if (is_allowed_volume(v))
{
add_volume_full(v.get_identifier(VolumeIdentifier.UUID),
v.get_name(), v.get_icon());
add_volume_full(v.get_uuid(), v.get_name(), v.get_icon());
}
}
......@@ -447,8 +446,7 @@ public class ConfigLocation : ConfigWidget
void update_volume(VolumeMonitor monitor, Volume v)
{
update_volume_full(v.get_identifier(VolumeIdentifier.UUID),
v.get_name(), v.get_icon());
update_volume_full(v.get_uuid(), v.get_name(), v.get_icon());
}
void update_volume_full(string uuid, string name, Icon icon)
......@@ -462,7 +460,7 @@ public class ConfigLocation : ConfigWidget
void remove_volume(VolumeMonitor monitor, Volume v)
{
remove_volume_full(v.get_identifier(VolumeIdentifier.UUID));
remove_volume_full(v.get_uuid());
}
void remove_volume_full(string uuid)
......@@ -624,6 +622,7 @@ public class ConfigLocation : ConfigWidget
// First things first, we must remember that we set a volume
all_settings[""].set_string(BACKEND_KEY, "drive");
all_settings[DRIVE_ROOT].set_string(DRIVE_UUID_KEY, uuid);
var vol = VolumeMonitor.get().get_volume_for_uuid(uuid);
if (vol == null) {
......
......@@ -125,7 +125,7 @@ public class BackendDrive : BackendFile
var icon = volume.get_icon();
// sanity check that these writable settings are for this volume
var vol_uuid = volume.get_identifier(VolumeIdentifier.UUID);
var vol_uuid = volume.get_uuid();
var settings_uuid = settings.get_string(DRIVE_UUID_KEY);
if (vol_uuid != settings_uuid)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment