Commit c8969ca6 authored by Corey Berla's avatar Corey Berla
Browse files

properties: Fix opening gnome-disks for root filesystem

With the introduction of nautilus-dbus-launcher, we made it so that
the current disk is selected in gnome-disks (when opening from the
properties window) by passing the disk identifier to --block-device.
This works fine for most mounted volumes, but breaks the ability to
open gnome-disks for the root filesystem because
g_file_find_enclosing_mount() doesn't return a mount for the root file
system (it only returns "user interesting locations").  Rather than
creating a more complicated setup, use the old behavior for the root
filesystem where no volume is selected by default.

Fixes: #2447
parent b6f2528b
......@@ -2613,12 +2613,20 @@ open_in_disks (NautilusPropertiesWindow *self)
mount = nautilus_file_get_mount (get_original_file (self));
volume = (mount != NULL) ? g_mount_get_volume (mount) : NULL;
device_identifier = g_volume_get_identifier (volume,
G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
parameters = g_variant_new_parsed ("(objectpath '/org/gnome/DiskUtility', "
"@aay [], {'options': <{'block-device': <%s>}> })",
device_identifier);
if (volume != NULL)
{
device_identifier = g_volume_get_identifier (volume,
G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
parameters = g_variant_new_parsed ("(objectpath '/org/gnome/DiskUtility', "
"@aay [], {'options': <{'block-device': <%s>}> })",
device_identifier);
}
else
{
parameters = g_variant_new_parsed ("(objectpath '/org/gnome/DiskUtility', @aay [], @a{sv} {})");
}
nautilus_dbus_launcher_call (launcher,
NAUTILUS_DBUS_LAUNCHER_DISKS,
......
Supports Markdown
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