[gnome-disk-utility/udisks2-port] Update for latest udisks2 changes



commit 12fd6cbecef6df3fad70cbf60d1555c6954a7fa4
Author: David Zeuthen <davidz redhat com>
Date:   Wed Aug 24 14:27:42 2011 -0400

    Update for latest udisks2 changes
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 src/palimpsest/gdudevicetreemodel.c |   26 ++--
 src/palimpsest/gduvolumegrid.c      |  162 ++++++++++----------
 src/palimpsest/gduvolumegrid.h      |    4 +-
 src/palimpsest/gduwindow.c          |  278 +++++++++++++++++-----------------
 4 files changed, 235 insertions(+), 235 deletions(-)
---
diff --git a/src/palimpsest/gdudevicetreemodel.c b/src/palimpsest/gdudevicetreemodel.c
index 3507d3a..73433b7 100644
--- a/src/palimpsest/gdudevicetreemodel.c
+++ b/src/palimpsest/gdudevicetreemodel.c
@@ -696,7 +696,7 @@ update_block (GduDeviceTreeModel  *model,
               UDisksObject        *object)
 {
   GtkTreeIter iter;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   UDisksLoop *loop;
   GIcon *icon = NULL;
   gchar *s = NULL;
@@ -715,13 +715,13 @@ update_block (GduDeviceTreeModel  *model,
       goto out;
     }
 
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
   loop = udisks_object_peek_loop (object);
 
-  size = udisks_block_device_get_size (block);
+  size = udisks_block_get_size (block);
   size_str = udisks_util_get_size_for_display (size, FALSE, FALSE);
 
-  preferred_device = udisks_block_device_get_preferred_device (block);
+  preferred_device = udisks_block_get_preferred_device (block);
   loop_backing_file = loop != NULL ? udisks_loop_get_backing_file (loop) : NULL;
   if (loop_backing_file != NULL)
     {
@@ -778,7 +778,7 @@ update_block (GduDeviceTreeModel  *model,
 static gboolean
 should_include_block (UDisksObject *object)
 {
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   gboolean ret;
   const gchar *device;
   const gchar *drive;
@@ -787,29 +787,29 @@ should_include_block (UDisksObject *object)
 
   ret = FALSE;
 
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
 
   /* RAM devices are useless */
-  device = udisks_block_device_get_device (block);
+  device = udisks_block_get_device (block);
   if (g_str_has_prefix (device, "/dev/ram"))
     goto out;
 
   /* Don't show devices of size zero - otherwise we'd end up showing unused loop devices */
-  size = udisks_block_device_get_size (block);
+  size = udisks_block_get_size (block);
   if (size == 0)
     goto out;
 
   /* Only include devices if they are top-level */
-  if (udisks_block_device_get_part_entry (block))
+  if (udisks_block_get_part_entry (block))
     goto out;
 
   /* Don't include if already shown in "Direct-Attached devices" */
-  drive = udisks_block_device_get_drive (block);
+  drive = udisks_block_get_drive (block);
   if (g_strcmp0 (drive, "/") != 0)
     goto out;
 
   /* Don't include if already shown in volume grid as an unlocked device */
-  crypto_backing_device = udisks_block_device_get_crypto_backing_device (block);
+  crypto_backing_device = udisks_block_get_crypto_backing_device (block);
   if (g_strcmp0 (crypto_backing_device, "/") != 0)
     goto out;
 
@@ -836,9 +836,9 @@ update_blocks (GduDeviceTreeModel *model)
   for (l = objects; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
 
-      block = udisks_object_peek_block_device (object);
+      block = udisks_object_peek_block (object);
       if (block == NULL)
         continue;
 
diff --git a/src/palimpsest/gduvolumegrid.c b/src/palimpsest/gduvolumegrid.c
index 9155563..4456a95 100644
--- a/src/palimpsest/gduvolumegrid.c
+++ b/src/palimpsest/gduvolumegrid.c
@@ -103,7 +103,7 @@ struct _GduVolumeGrid
   GtkWidget parent;
 
   UDisksClient *client;
-  UDisksObject *block_device;
+  UDisksObject *block_object;
 
   gboolean container_visible;
   gchar *container_markup;
@@ -129,7 +129,7 @@ enum
 {
   PROP_0,
   PROP_CLIENT,
-  PROP_BLOCK_DEVICE
+  PROP_BLOCK_OBJECT
 };
 
 enum
@@ -220,8 +220,8 @@ gdu_volume_grid_finalize (GObject *object)
       grid->animation_timeout_id = 0;
     }
 
-  if (grid->block_device != NULL)
-    g_object_unref (grid->block_device);
+  if (grid->block_object != NULL)
+    g_object_unref (grid->block_object);
   g_object_unref (grid->client);
 
   G_OBJECT_CLASS (gdu_volume_grid_parent_class)->finalize (object);
@@ -241,8 +241,8 @@ gdu_volume_grid_get_property (GObject    *object,
       g_value_set_object (value, grid->client);
       break;
 
-    case PROP_BLOCK_DEVICE:
-      g_value_set_object (value, grid->block_device);
+    case PROP_BLOCK_OBJECT:
+      g_value_set_object (value, grid->block_object);
       break;
 
     default:
@@ -265,8 +265,8 @@ gdu_volume_grid_set_property (GObject      *object,
       grid->client = g_value_dup_object (value);
       break;
 
-    case PROP_BLOCK_DEVICE:
-      gdu_volume_grid_set_block_device (grid, g_value_get_object (value));
+    case PROP_BLOCK_OBJECT:
+      gdu_volume_grid_set_block_object (grid, g_value_get_object (value));
       break;
 
     default:
@@ -588,10 +588,10 @@ gdu_volume_grid_class_init (GduVolumeGridClass *klass)
                                                         G_PARAM_STATIC_STRINGS));
 
   g_object_class_install_property (gobject_class,
-                                   PROP_BLOCK_DEVICE,
-                                   g_param_spec_object ("block-device",
-                                                        "Block Device",
-                                                        "The top-level block device to show a grid for",
+                                   PROP_BLOCK_OBJECT,
+                                   g_param_spec_object ("block-object",
+                                                        "Block Object",
+                                                        "The top-level block object to show a grid for",
                                                         G_TYPE_DBUS_OBJECT,
                                                         G_PARAM_READABLE |
                                                         G_PARAM_WRITABLE |
@@ -625,31 +625,31 @@ gdu_volume_grid_new (UDisksClient *client)
 }
 
 UDisksObject *
-gdu_volume_grid_get_block_device (GduVolumeGrid *grid)
+gdu_volume_grid_get_block_object (GduVolumeGrid *grid)
 {
   g_return_val_if_fail (GDU_IS_VOLUME_GRID (grid), NULL);
-  return grid->block_device;
+  return grid->block_object;
 }
 
 void
-gdu_volume_grid_set_block_device (GduVolumeGrid     *grid,
-                                  UDisksObject  *block_device)
+gdu_volume_grid_set_block_object (GduVolumeGrid *grid,
+                                  UDisksObject  *block_object)
 {
   g_return_if_fail (GDU_IS_VOLUME_GRID (grid));
 
-  if (block_device == grid->block_device)
+  if (block_object == grid->block_object)
     goto out;
 
-  if (grid->block_device != NULL)
-    g_object_unref (grid->block_device);
-  grid->block_device = block_device != NULL ? g_object_ref (block_device) : NULL;
+  if (grid->block_object != NULL)
+    g_object_unref (grid->block_object);
+  grid->block_object = block_object != NULL ? g_object_ref (block_object) : NULL;
 
   /* this causes recompute_grid() to select the first element */
   grid->selected = NULL;
   grid->focused = NULL;
   recompute_grid (grid);
 
-  g_object_notify (G_OBJECT (grid), "block-device");
+  g_object_notify (G_OBJECT (grid), "block-object");
 
   g_signal_emit (grid,
                  signals[CHANGED_SIGNAL],
@@ -1446,8 +1446,8 @@ partition_sort_by_offset_func (UDisksObject *a,
 {
   guint64 oa;
   guint64 ob;
-  oa = udisks_block_device_get_part_entry_offset (udisks_object_peek_block_device (a));
-  ob = udisks_block_device_get_part_entry_offset (udisks_object_peek_block_device (b));
+  oa = udisks_block_get_part_entry_offset (udisks_object_peek_block (a));
+  ob = udisks_block_get_part_entry_offset (udisks_object_peek_block (b));
   if (oa > ob)
     return 1;
   else if (oa < ob)
@@ -1475,13 +1475,13 @@ lookup_cleartext_device_for_crypto_device (GduVolumeGrid *grid,
   for (l = objects; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
 
-      block = udisks_object_peek_block_device (object);
+      block = udisks_object_peek_block (object);
       if (block == NULL)
         continue;
 
-      if (g_strcmp0 (udisks_block_device_get_crypto_backing_device (block),
+      if (g_strcmp0 (udisks_block_get_crypto_backing_device (block),
                      object_path) == 0)
         {
           ret = g_object_ref (object);
@@ -1499,7 +1499,7 @@ static GridElement *
 maybe_add_crypto (GduVolumeGrid    *grid,
                   GridElement      *element)
 {
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   GridElement *cleartext_element;
 
   cleartext_element = NULL;
@@ -1507,11 +1507,11 @@ maybe_add_crypto (GduVolumeGrid    *grid,
   if (element->object == NULL)
     goto out;
 
-  block = udisks_object_peek_block_device (element->object);
+  block = udisks_object_peek_block (element->object);
   if (block == NULL)
     goto out;
 
-  if (g_strcmp0 (udisks_block_device_get_id_usage (block), "crypto") == 0)
+  if (g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0)
     {
       UDisksObject *cleartext_object;
       GridElement *embedded_cleartext_element;
@@ -1531,7 +1531,7 @@ maybe_add_crypto (GduVolumeGrid    *grid,
           cleartext_element->size_ratio = 1.0;
           cleartext_element->object = g_object_ref (cleartext_object);
           cleartext_element->offset = 0;
-          cleartext_element->size = udisks_block_device_get_size (udisks_object_peek_block_device (cleartext_object));
+          cleartext_element->size = udisks_block_get_size (udisks_object_peek_block (cleartext_object));
           grid_element_set_details (grid, cleartext_element);
 
           /* recurse to handle multiple layers of encryption... */
@@ -1573,12 +1573,12 @@ recompute_grid_add_partitions (GduVolumeGrid  *grid,
   for (l = partitions; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
       guint64 begin, end, size;
 
-      block = udisks_object_peek_block_device (object);
-      begin = udisks_block_device_get_part_entry_offset (block);
-      size = udisks_block_device_get_part_entry_size (block);
+      block = udisks_object_peek_block (object);
+      begin = udisks_block_get_part_entry_offset (block);
+      size = udisks_block_get_part_entry_size (block);
       end = begin + size;
 
       if (begin - prev_end > free_space_slack)
@@ -1600,7 +1600,7 @@ recompute_grid_add_partitions (GduVolumeGrid  *grid,
       element = g_new0 (GridElement, 1);
       element->type = GDU_VOLUME_GRID_ELEMENT_TYPE_DEVICE;
       element->parent = parent;
-      element->size_ratio = ((gdouble) udisks_block_device_get_part_entry_size (block)) / top_size;
+      element->size_ratio = ((gdouble) udisks_block_get_part_entry_size (block)) / top_size;
       element->object = g_object_ref (object);
       element->offset = begin;
       element->size = size;
@@ -1618,8 +1618,8 @@ recompute_grid_add_partitions (GduVolumeGrid  *grid,
                                                                       total_size,
                                                                       element,
                                                                       free_space_slack,
-                                                                      udisks_block_device_get_part_entry_offset (block),
-                                                                      udisks_block_device_get_part_entry_size (block),
+                                                                      udisks_block_get_part_entry_offset (block),
+                                                                      udisks_block_get_part_entry_size (block),
                                                                       logical_partitions,
                                                                       NULL,
                                                                       NULL);
@@ -1661,7 +1661,7 @@ recompute_grid (GduVolumeGrid *grid)
   GDBusObjectManager *object_manager;
   GList *l;
   const gchar *top_object_path;
-  UDisksBlockDevice *top_block;
+  UDisksBlock *top_block;
   guint64 top_size;
   guint64 free_space_slack;
   GridElement *element;
@@ -1691,8 +1691,8 @@ recompute_grid (GduVolumeGrid *grid)
   grid->elements = NULL;
 
   //g_debug ("TODO: recompute grid for %s, container_visible=%d",
-  //         grid->block_device != NULL ?
-  //         g_dbus_object_get_object_path (grid->block_device) : "<nothing selected>",
+  //         grid->block_object != NULL ?
+  //         g_dbus_object_get_object_path (grid->block_object) : "<nothing selected>",
   //         grid->container_visible);
 
   if (grid->container_visible)
@@ -1707,7 +1707,7 @@ recompute_grid (GduVolumeGrid *grid)
       grid->elements = g_list_append (grid->elements, element);
     }
 
-  if (grid->block_device == NULL)
+  if (grid->block_object == NULL)
     {
       element = g_new0 (GridElement, 1);
       element->type = GDU_VOLUME_GRID_ELEMENT_TYPE_NO_MEDIA;
@@ -1724,9 +1724,9 @@ recompute_grid (GduVolumeGrid *grid)
       goto out;
     }
 
-  top_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (grid->block_device));
-  top_block = udisks_object_peek_block_device (grid->block_device);
-  top_size = udisks_block_device_get_size (top_block);
+  top_object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (grid->block_object));
+  top_block = udisks_object_peek_block (grid->block_object);
+  top_size = udisks_block_get_size (top_block);
 
   /* include "Free Space" elements if there is at least this much slack between
    * partitions (currently 1% of the disk, at least 1MB)
@@ -1741,25 +1741,25 @@ recompute_grid (GduVolumeGrid *grid)
   for (l = objects; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
       gboolean is_logical;
 
-      block = udisks_object_peek_block_device (object);
+      block = udisks_object_peek_block (object);
       if (block != NULL &&
-          g_strcmp0 (udisks_block_device_get_part_entry_table (block),
+          g_strcmp0 (udisks_block_get_part_entry_table (block),
                      top_object_path) == 0)
         {
           is_logical = FALSE;
-          if (g_strcmp0 (udisks_block_device_get_part_entry_scheme (block), "mbr") == 0)
+          if (g_strcmp0 (udisks_block_get_part_entry_scheme (block), "mbr") == 0)
             {
-              if (udisks_block_device_get_part_entry_number (block) >= 5)
+              if (udisks_block_get_part_entry_number (block) >= 5)
                 {
                   is_logical = TRUE;
                 }
               else
                 {
                   gint type;
-                  type = strtol (udisks_block_device_get_part_entry_type (block), NULL, 0);
+                  type = strtol (udisks_block_get_part_entry_type (block), NULL, 0);
                   if (type == 0x05 || type == 0x0f || type == 0x85)
                     {
                       g_warn_if_fail (extended_partition == NULL);
@@ -1775,7 +1775,7 @@ recompute_grid (GduVolumeGrid *grid)
         }
     }
 
-  if (partitions == NULL && !udisks_block_device_get_part_table (top_block))
+  if (partitions == NULL && !udisks_block_get_part_table (top_block))
     {
       /* No partitions and whole-disk has no partition table signature... */
       if (top_size == 0)
@@ -1801,7 +1801,7 @@ recompute_grid (GduVolumeGrid *grid)
           element->size_ratio = 1.0;
           element->offset = 0;
           element->size = top_size;
-          element->object = g_object_ref (grid->block_device);
+          element->object = g_object_ref (grid->block_object);
           if (grid->elements != NULL)
             {
               ((GridElement *) grid->elements->data)->next = element;
@@ -1903,11 +1903,11 @@ grid_element_set_details (GduVolumeGrid  *grid,
       {
         element->markup = g_strdup (_("No Media"));
 
-        if (grid->block_device != NULL)
+        if (grid->block_object != NULL)
           {
-            UDisksBlockDevice *block;
-            block = udisks_object_peek_block_device (grid->block_device);
-            if (block != NULL && g_variant_n_children (udisks_block_device_get_configuration (block)) > 0)
+            UDisksBlock *block;
+            block = udisks_object_peek_block (grid->block_object);
+            if (block != NULL && g_variant_n_children (udisks_block_get_configuration (block)) > 0)
               element->show_configured = TRUE;
           }
       }
@@ -1926,7 +1926,7 @@ grid_element_set_details (GduVolumeGrid  *grid,
 
     case GDU_VOLUME_GRID_ELEMENT_TYPE_DEVICE:
       {
-        UDisksBlockDevice *block;
+        UDisksBlock *block;
         gchar *s;
         gchar *size_str;
         const gchar *usage;
@@ -1936,18 +1936,18 @@ grid_element_set_details (GduVolumeGrid  *grid,
         gchar *type_for_display;
 
         size_str = udisks_util_get_size_for_display (element->size, FALSE, FALSE);
-        block = udisks_object_peek_block_device (element->object);
+        block = udisks_object_peek_block (element->object);
 
-        usage = udisks_block_device_get_id_usage (block);
-        type = udisks_block_device_get_id_type (block);
-        version = udisks_block_device_get_id_version (block);
-        partition_type = strtol (udisks_block_device_get_part_entry_type (block), NULL, 0);
+        usage = udisks_block_get_id_usage (block);
+        type = udisks_block_get_id_type (block);
+        version = udisks_block_get_id_version (block);
+        partition_type = strtol (udisks_block_get_part_entry_type (block), NULL, 0);
 
-        if (g_variant_n_children (udisks_block_device_get_configuration (block)) > 0)
+        if (g_variant_n_children (udisks_block_get_configuration (block)) > 0)
           element->show_configured = TRUE;
 
-        if (udisks_block_device_get_part_entry (block) &&
-            g_strcmp0 (udisks_block_device_get_part_entry_scheme (block), "mbr") == 0 &&
+        if (udisks_block_get_part_entry (block) &&
+            g_strcmp0 (udisks_block_get_part_entry_scheme (block), "mbr") == 0 &&
             (partition_type == 0x05 || partition_type == 0x0f || partition_type == 0x85))
           {
             s = g_strdup_printf ("%s\n%s",
@@ -1959,7 +1959,7 @@ grid_element_set_details (GduVolumeGrid  *grid,
             const gchar *label;
             UDisksFilesystem *filesystem;
 
-            label = udisks_block_device_get_id_label (block);
+            label = udisks_block_get_id_label (block);
             type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
             if (strlen (label) == 0)
               label = C_("volume-grid", "Filesystem");
@@ -1980,7 +1980,7 @@ grid_element_set_details (GduVolumeGrid  *grid,
             const gchar *label;
             UDisksSwapspace *swapspace;
 
-            label = udisks_block_device_get_id_label (block);
+            label = udisks_block_get_id_label (block);
             type_for_display = udisks_util_get_id_for_display (usage, type, version, FALSE);
             if (strlen (label) == 0)
               label = C_("volume-grid", "Swap");
@@ -2013,20 +2013,20 @@ grid_element_set_details (GduVolumeGrid  *grid,
 
 static gboolean
 is_disk_or_partition_in_grid (GduVolumeGrid *grid,
-                              UDisksObject   *object)
+                              UDisksObject  *block_object)
 {
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   gboolean ret;
 
   ret = FALSE;
 
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (block_object);
   if (block == NULL)
     goto out;
 
-  if (object == grid->block_device ||
-      g_strcmp0 (udisks_block_device_get_part_entry_table (block),
-                 g_dbus_object_get_object_path (G_DBUS_OBJECT (grid->block_device))) == 0)
+  if (block_object == grid->block_object ||
+      g_strcmp0 (udisks_block_get_part_entry_table (block),
+                 g_dbus_object_get_object_path (G_DBUS_OBJECT (grid->block_object))) == 0)
     ret = TRUE;
 
  out:
@@ -2034,34 +2034,34 @@ is_disk_or_partition_in_grid (GduVolumeGrid *grid,
 }
 
 gboolean
-gdu_volume_grid_includes_object (GduVolumeGrid       *grid,
-                                       UDisksObject    *object)
+gdu_volume_grid_includes_object (GduVolumeGrid   *grid,
+                                 UDisksObject    *block_object)
 {
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   const gchar *crypto_backing_device;
   UDisksObject *crypto_object;
   gboolean ret;
 
   g_return_val_if_fail (GDU_IS_VOLUME_GRID (grid), FALSE);
-  g_return_val_if_fail (G_IS_DBUS_OBJECT (object), FALSE);
+  g_return_val_if_fail (G_IS_DBUS_OBJECT (block_object), FALSE);
 
   ret = FALSE;
   crypto_object = NULL;
 
-  if (grid->block_device == NULL)
+  if (grid->block_object == NULL)
     goto out;
 
-  if (is_disk_or_partition_in_grid (grid, object))
+  if (is_disk_or_partition_in_grid (grid, block_object))
     {
       ret = TRUE;
       goto out;
     }
 
   /* handle when it's a crypt devices for our grid or a partition in it */
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (block_object);
   if (block != NULL)
     {
-      crypto_backing_device = udisks_block_device_get_crypto_backing_device (block);
+      crypto_backing_device = udisks_block_get_crypto_backing_device (block);
       crypto_object = (UDisksObject *) g_dbus_object_manager_get_object (udisks_client_get_object_manager (grid->client),
                                                                          crypto_backing_device);
       if (crypto_object != NULL)
diff --git a/src/palimpsest/gduvolumegrid.h b/src/palimpsest/gduvolumegrid.h
index e51c526..544561d 100644
--- a/src/palimpsest/gduvolumegrid.h
+++ b/src/palimpsest/gduvolumegrid.h
@@ -34,9 +34,9 @@ G_BEGIN_DECLS
 
 GType                     gdu_volume_grid_get_type              (void) G_GNUC_CONST;
 GtkWidget*                gdu_volume_grid_new                   (UDisksClient        *client);
-void                      gdu_volume_grid_set_block_device      (GduVolumeGrid       *grid,
+void                      gdu_volume_grid_set_block_object      (GduVolumeGrid       *grid,
                                                                  UDisksObject        *block_device);
-UDisksObject             *gdu_volume_grid_get_block_device      (GduVolumeGrid      *grid);
+UDisksObject             *gdu_volume_grid_get_block_object      (GduVolumeGrid      *grid);
 void                      gdu_volume_grid_set_container_visible (GduVolumeGrid       *grid,
                                                                  gboolean             visible);
 void                      gdu_volume_grid_set_container_markup  (GduVolumeGrid       *grid,
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index 456089c..63e49a3 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -366,7 +366,7 @@ set_selected_object (GduWindow    *window,
   if (object != NULL)
     {
       if (udisks_object_peek_drive (object) != NULL ||
-          udisks_object_peek_block_device (object) != NULL)
+          udisks_object_peek_block (object) != NULL)
         {
           select_details_page (window, object, DETAILS_PAGE_DEVICE, &show_flags);
         }
@@ -1144,8 +1144,8 @@ set_size (GduWindow      *window,
 }
 
 static GList *
-get_top_level_block_devices_for_drive (GduWindow   *window,
-                                       const gchar *drive_object_path)
+get_top_level_blocks_for_drive (GduWindow   *window,
+                                const gchar *drive_object_path)
 {
   GList *ret;
   GList *l;
@@ -1159,14 +1159,14 @@ get_top_level_block_devices_for_drive (GduWindow   *window,
   for (l = object_proxies; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
 
-      block = udisks_object_get_block_device (object);
+      block = udisks_object_get_block (object);
       if (block == NULL)
         continue;
 
-      if (g_strcmp0 (udisks_block_device_get_drive (block), drive_object_path) == 0 &&
-          !udisks_block_device_get_part_entry (block))
+      if (g_strcmp0 (udisks_block_get_drive (block), drive_object_path) == 0 &&
+          !udisks_block_get_part_entry (block))
         {
           ret = g_list_append (ret, g_object_ref (object));
         }
@@ -1178,11 +1178,11 @@ get_top_level_block_devices_for_drive (GduWindow   *window,
 }
 
 static gint
-block_device_compare_on_preferred (UDisksObject *a,
-                                   UDisksObject *b)
+block_compare_on_preferred (UDisksObject *a,
+                            UDisksObject *b)
 {
-  return g_strcmp0 (udisks_block_device_get_preferred_device (udisks_object_peek_block_device (a)),
-                    udisks_block_device_get_preferred_device (udisks_object_peek_block_device (b)));
+  return g_strcmp0 (udisks_block_get_preferred_device (udisks_object_peek_block (a)),
+                    udisks_block_get_preferred_device (udisks_object_peek_block (b)));
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -1348,7 +1348,7 @@ on_volume_grid_changed (GduVolumeGrid  *grid,
 {
   GduWindow *window = GDU_WINDOW (user_data);
   // g_debug ("on_volume_grid_changed");
-  update_all (window, gdu_volume_grid_get_block_device (GDU_VOLUME_GRID (window->volume_grid)));
+  update_all (window, gdu_volume_grid_get_block_object (GDU_VOLUME_GRID (window->volume_grid)));
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -1358,15 +1358,15 @@ setup_device_page (GduWindow     *window,
                    UDisksObject  *object)
 {
   UDisksDrive *drive;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
 
   drive = udisks_object_peek_drive (object);
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
 
   gdu_volume_grid_set_container_visible (GDU_VOLUME_GRID (window->volume_grid), FALSE);
   if (drive != NULL)
     {
-      GList *block_devices;
+      GList *blocks;
       gchar *drive_name;
       gchar *drive_desc;
       GIcon *drive_icon;
@@ -1374,8 +1374,8 @@ setup_device_page (GduWindow     *window,
       GIcon *drive_media_icon;
 
       /* TODO: for multipath, ensure e.g. mpathk is before sda, sdb */
-      block_devices = get_top_level_block_devices_for_drive (window, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
-      block_devices = g_list_sort (block_devices, (GCompareFunc) block_device_compare_on_preferred);
+      blocks = get_top_level_blocks_for_drive (window, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
+      blocks = g_list_sort (blocks, (GCompareFunc) block_compare_on_preferred);
 
       udisks_util_get_drive_info (drive,
                                   &drive_name,
@@ -1383,10 +1383,10 @@ setup_device_page (GduWindow     *window,
                                   &drive_icon,
                                   &drive_media_desc,
                                   &drive_media_icon);
-      if (block_devices != NULL)
-        gdu_volume_grid_set_block_device (GDU_VOLUME_GRID (window->volume_grid), block_devices->data);
+      if (blocks != NULL)
+        gdu_volume_grid_set_block_object (GDU_VOLUME_GRID (window->volume_grid), blocks->data);
       else
-        gdu_volume_grid_set_block_device (GDU_VOLUME_GRID (window->volume_grid), NULL);
+        gdu_volume_grid_set_block_object (GDU_VOLUME_GRID (window->volume_grid), NULL);
 
       g_free (drive_name);
       g_free (drive_desc);
@@ -1395,12 +1395,12 @@ setup_device_page (GduWindow     *window,
       if (drive_media_icon != NULL)
         g_object_unref (drive_media_icon);
 
-      g_list_foreach (block_devices, (GFunc) g_object_unref, NULL);
-      g_list_free (block_devices);
+      g_list_foreach (blocks, (GFunc) g_object_unref, NULL);
+      g_list_free (blocks);
     }
   else if (block != NULL)
     {
-      gdu_volume_grid_set_block_device (GDU_VOLUME_GRID (window->volume_grid), object);
+      gdu_volume_grid_set_block_object (GDU_VOLUME_GRID (window->volume_grid), object);
     }
   else
     {
@@ -1415,7 +1415,7 @@ update_device_page_for_drive (GduWindow      *window,
                               ShowFlags      *show_flags)
 {
   gchar *s;
-  GList *block_devices;
+  GList *blocks;
   GList *l;
   GString *str;
   const gchar *drive_vendor;
@@ -1433,8 +1433,8 @@ update_device_page_for_drive (GduWindow      *window,
   //         object != NULL ? g_dbus_object_get_object_path (object) : "<nothing>");
 
   /* TODO: for multipath, ensure e.g. mpathk is before sda, sdb */
-  block_devices = get_top_level_block_devices_for_drive (window, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
-  block_devices = g_list_sort (block_devices, (GCompareFunc) block_device_compare_on_preferred);
+  blocks = get_top_level_blocks_for_drive (window, g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
+  blocks = g_list_sort (blocks, (GCompareFunc) block_compare_on_preferred);
 
   ata = udisks_object_peek_drive_ata (object);
 
@@ -1445,12 +1445,12 @@ update_device_page_for_drive (GduWindow      *window,
   drive_revision = udisks_drive_get_revision (drive);
 
   str = g_string_new (NULL);
-  for (l = block_devices; l != NULL; l = l->next)
+  for (l = blocks; l != NULL; l = l->next)
     {
       UDisksObject *block_object = UDISKS_OBJECT (l->data);
       if (str->len > 0)
         g_string_append_c (str, ' ');
-      g_string_append (str, udisks_block_device_get_preferred_device (udisks_object_peek_block_device (block_object)));
+      g_string_append (str, udisks_block_get_preferred_device (udisks_object_peek_block (block_object)));
     }
   s = g_strdup_printf ("<big><b>%s</b></big>\n"
                        "<small><span foreground=\"#555555\">%s</span></small>",
@@ -1590,8 +1590,8 @@ update_device_page_for_drive (GduWindow      *window,
       *show_flags |= SHOW_FLAGS_EJECT_BUTTON;
     }
 
-  g_list_foreach (block_devices, (GFunc) g_object_unref, NULL);
-  g_list_free (block_devices);
+  g_list_foreach (blocks, (GFunc) g_object_unref, NULL);
+  g_list_free (blocks);
   if (media_icon != NULL)
     g_object_unref (media_icon);
   g_object_unref (drive_icon);
@@ -1616,13 +1616,13 @@ lookup_cleartext_device_for_crypto_device (UDisksClient  *client,
   for (l = objects; l != NULL; l = l->next)
     {
       UDisksObject *object = UDISKS_OBJECT (l->data);
-      UDisksBlockDevice *block;
+      UDisksBlock *block;
 
-      block = udisks_object_peek_block_device (object);
+      block = udisks_object_peek_block (object);
       if (block == NULL)
         continue;
 
-      if (g_strcmp0 (udisks_block_device_get_crypto_backing_device (block),
+      if (g_strcmp0 (udisks_block_get_crypto_backing_device (block),
                      object_path) == 0)
         {
           ret = g_object_ref (object);
@@ -1658,8 +1658,8 @@ options_has (const gchar *options, const gchar *str)
 }
 
 static gchar *
-calculate_configuration_for_display (UDisksBlockDevice *block,
-                                     guint              show_flags)
+calculate_configuration_for_display (UDisksBlock *block,
+                                     guint        show_flags)
 {
   GString *str;
   GVariantIter iter;
@@ -1677,7 +1677,7 @@ calculate_configuration_for_display (UDisksBlockDevice *block,
    */
 
   str = g_string_new (NULL);
-  g_variant_iter_init (&iter, udisks_block_device_get_configuration (block));
+  g_variant_iter_init (&iter, udisks_block_get_configuration (block));
   while (g_variant_iter_next (&iter, "(&s a{sv})", &type, &details))
     {
       if (g_strcmp0 (type, "fstab") == 0)
@@ -1691,8 +1691,8 @@ calculate_configuration_for_display (UDisksBlockDevice *block,
                 options = "";
               if (options_has (options, "noauto"))
                 {
-                  if (g_strcmp0 (udisks_block_device_get_id_usage (block), "other") == 0 &&
-                      g_strcmp0 (udisks_block_device_get_id_type (block), "swap") == 0)
+                  if (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
+                      g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0)
                     {
                       /* Translators: Shown when the device is configured in /etc/fstab
                        * is a swap device but not automatically mounted at boot time.
@@ -1711,8 +1711,8 @@ calculate_configuration_for_display (UDisksBlockDevice *block,
                 }
               else
                 {
-                  if (g_strcmp0 (udisks_block_device_get_id_usage (block), "other") == 0 &&
-                      g_strcmp0 (udisks_block_device_get_id_type (block), "swap") == 0)
+                  if (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
+                      g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0)
                     {
                       /* Translators: Shown when the device is configured in /etc/fstab
                        * is a swap device and automatically activated at boot time.
@@ -1773,10 +1773,10 @@ calculate_configuration_for_display (UDisksBlockDevice *block,
        * know how to configure the device or already offer to
        * configure the device...
        */
-      if (g_strcmp0 (udisks_block_device_get_id_usage (block), "filesystem") == 0 ||
-          (g_strcmp0 (udisks_block_device_get_id_usage (block), "other") == 0 &&
-           g_strcmp0 (udisks_block_device_get_id_type (block), "swap") == 0) ||
-          g_strcmp0 (udisks_block_device_get_id_usage (block), "crypto") == 0 ||
+      if (g_strcmp0 (udisks_block_get_id_usage (block), "filesystem") == 0 ||
+          (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
+           g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0) ||
+          g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0 ||
           show_flags & (SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB | SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB))
         {
           /* Translators: Shown when the device is not configured */
@@ -1795,9 +1795,9 @@ calculate_configuration_for_display (UDisksBlockDevice *block,
 }
 
 static gboolean
-has_configuration (UDisksBlockDevice *block,
-                   const gchar       *type,
-                   gboolean          *out_has_passphrase)
+has_configuration (UDisksBlock  *block,
+                   const gchar  *type,
+                   gboolean     *out_has_passphrase)
 {
   GVariantIter iter;
   const gchar *config_type;
@@ -1808,7 +1808,7 @@ has_configuration (UDisksBlockDevice *block,
   ret = FALSE;
   has_passphrase = FALSE;
 
-  g_variant_iter_init (&iter, udisks_block_device_get_configuration (block));
+  g_variant_iter_init (&iter, udisks_block_get_configuration (block));
   while (g_variant_iter_next (&iter, "(&s a{sv})", &config_type, &config_details))
     {
       if (g_strcmp0 (config_type, type) == 0)
@@ -1837,7 +1837,7 @@ has_configuration (UDisksBlockDevice *block,
 static void
 update_device_page_for_block (GduWindow          *window,
                               UDisksObject       *object,
-                              UDisksBlockDevice  *block,
+                              UDisksBlock        *block,
                               guint64             size,
                               ShowFlags          *show_flags)
 {
@@ -1862,7 +1862,7 @@ update_device_page_for_block (GduWindow          *window,
    * show CONFIGURE_FSTAB since the user might want to add an entry for e.g.
    * /media/cdrom
    */
-  if (udisks_block_device_get_size (block) == 0 &&
+  if (udisks_block_get_size (block) == 0 &&
       !(*show_flags & (SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB |
                        SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB)))
     {
@@ -1876,7 +1876,7 @@ update_device_page_for_block (GduWindow          *window,
   set_markup (window,
               "devtab-device-label",
               "devtab-device-value-label",
-              udisks_block_device_get_preferred_device (block), SET_MARKUP_FLAGS_NONE);
+              udisks_block_get_preferred_device (block), SET_MARKUP_FLAGS_NONE);
   if (size > 0)
     {
       set_size (window,
@@ -1892,15 +1892,15 @@ update_device_page_for_block (GduWindow          *window,
                   NULL, SET_MARKUP_FLAGS_HYPHEN_IF_EMPTY);
     }
 
-  usage = udisks_block_device_get_id_usage (block);
-  type = udisks_block_device_get_id_type (block);
-  version = udisks_block_device_get_id_version (block);
-  partition_type = strtol (udisks_block_device_get_part_entry_type (block), NULL, 0);
+  usage = udisks_block_get_id_usage (block);
+  type = udisks_block_get_id_type (block);
+  version = udisks_block_get_id_version (block);
+  partition_type = strtol (udisks_block_get_part_entry_type (block), NULL, 0);
 
   if (size > 0)
     {
-      if (udisks_block_device_get_part_entry (block) &&
-          g_strcmp0 (udisks_block_device_get_part_entry_scheme (block), "mbr") == 0 &&
+      if (udisks_block_get_part_entry (block) &&
+          g_strcmp0 (udisks_block_get_part_entry_scheme (block), "mbr") == 0 &&
           (partition_type == 0x05 || partition_type == 0x0f || partition_type == 0x85))
         {
           type_for_display = g_strdup (_("Extended Partition"));
@@ -1921,7 +1921,7 @@ update_device_page_for_block (GduWindow          *window,
               SET_MARKUP_FLAGS_HYPHEN_IF_EMPTY);
   g_free (type_for_display);
 
-  if (udisks_block_device_get_part_entry (block))
+  if (udisks_block_get_part_entry (block))
     {
       *show_flags |= SHOW_FLAGS_POPUP_MENU_EDIT_PARTITION;
     }
@@ -1929,7 +1929,7 @@ update_device_page_for_block (GduWindow          *window,
     {
       UDisksObject *drive_object;
       drive_object = (UDisksObject *) g_dbus_object_manager_get_object (udisks_client_get_object_manager (window->client),
-                                                                        udisks_block_device_get_drive (block));
+                                                                        udisks_block_get_drive (block));
       if (drive_object != NULL)
         {
           UDisksDrive *drive;
@@ -1940,7 +1940,7 @@ update_device_page_for_block (GduWindow          *window,
         }
     }
 
-  if (g_strcmp0 (udisks_block_device_get_id_usage (block), "filesystem") == 0)
+  if (g_strcmp0 (udisks_block_get_id_usage (block), "filesystem") == 0)
     {
       UDisksFilesystem *filesystem;
 
@@ -1988,8 +1988,8 @@ update_device_page_for_block (GduWindow          *window,
       *show_flags |= SHOW_FLAGS_POPUP_MENU_EDIT_LABEL;
       *show_flags |= SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB;
     }
-  else if (g_strcmp0 (udisks_block_device_get_id_usage (block), "other") == 0 &&
-           g_strcmp0 (udisks_block_device_get_id_type (block), "swap") == 0)
+  else if (g_strcmp0 (udisks_block_get_id_usage (block), "other") == 0 &&
+           g_strcmp0 (udisks_block_get_id_type (block), "swap") == 0)
     {
       UDisksSwapspace *swapspace;
       const gchar *str;
@@ -2015,7 +2015,7 @@ update_device_page_for_block (GduWindow          *window,
                       SET_MARKUP_FLAGS_NONE);
         }
     }
-  else if (g_strcmp0 (udisks_block_device_get_id_usage (block), "crypto") == 0)
+  else if (g_strcmp0 (udisks_block_get_id_usage (block), "crypto") == 0)
     {
       UDisksObject *cleartext_device;
       const gchar *str;
@@ -2058,7 +2058,7 @@ update_device_page_for_block (GduWindow          *window,
 static void
 update_device_page_for_no_media (GduWindow          *window,
                                  UDisksObject       *object,
-                                 UDisksBlockDevice  *block,
+                                 UDisksBlock        *block,
                                  ShowFlags          *show_flags)
 {
   //g_debug ("In update_device_page_for_no_media() - selected=%s",
@@ -2068,7 +2068,7 @@ update_device_page_for_no_media (GduWindow          *window,
 static void
 update_device_page_for_free_space (GduWindow          *window,
                                    UDisksObject       *object,
-                                   UDisksBlockDevice  *block,
+                                   UDisksBlock        *block,
                                    guint64             size,
                                    ShowFlags          *show_flags)
 {
@@ -2079,7 +2079,7 @@ update_device_page_for_free_space (GduWindow          *window,
   set_markup (window,
               "devtab-device-label",
               "devtab-device-value-label",
-              udisks_block_device_get_preferred_device (block), SET_MARKUP_FLAGS_NONE);
+              udisks_block_get_preferred_device (block), SET_MARKUP_FLAGS_NONE);
   set_size (window,
             "devtab-size-label",
             "devtab-size-value-label",
@@ -2098,7 +2098,7 @@ update_device_page (GduWindow      *window,
 {
   UDisksObject *object;
   GduVolumeGridElementType type;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   UDisksDrive *drive;
   guint64 size;
   GList *children;
@@ -2119,7 +2119,7 @@ update_device_page (GduWindow      *window,
 
   object = window->current_object;
   drive = udisks_object_peek_drive (window->current_object);
-  block = udisks_object_peek_block_device (window->current_object);
+  block = udisks_object_peek_block (window->current_object);
   type = gdu_volume_grid_get_selected_type (GDU_VOLUME_GRID (window->volume_grid));
   size = gdu_volume_grid_get_selected_size (GDU_VOLUME_GRID (window->volume_grid));
 
@@ -2138,10 +2138,10 @@ update_device_page (GduWindow      *window,
     {
       object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
       if (object == NULL)
-        object = gdu_volume_grid_get_block_device (GDU_VOLUME_GRID (window->volume_grid));
+        object = gdu_volume_grid_get_block_object (GDU_VOLUME_GRID (window->volume_grid));
       if (object != NULL)
         {
-          block = udisks_object_peek_block_device (object);
+          block = udisks_object_peek_block (object);
           switch (type)
             {
             case GDU_VOLUME_GRID_ELEMENT_TYPE_CONTAINER:
@@ -2168,7 +2168,7 @@ update_device_page (GduWindow      *window,
 static void
 teardown_device_page (GduWindow *window)
 {
-  gdu_volume_grid_set_block_device (GDU_VOLUME_GRID (window->volume_grid), NULL);
+  gdu_volume_grid_set_block_object (GDU_VOLUME_GRID (window->volume_grid), NULL);
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -2267,7 +2267,7 @@ on_generic_menu_item_edit_label (GtkMenuItem *menu_item,
   GtkWidget *dialog;
   GtkWidget *entry;
   UDisksObject *object;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   UDisksFilesystem *filesystem;
   const gchar *label;
   ChangeFilesystemLabelData data;
@@ -2275,7 +2275,7 @@ on_generic_menu_item_edit_label (GtkMenuItem *menu_item,
 
   object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
   g_assert (object != NULL);
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
   filesystem = udisks_object_peek_filesystem (object);
   g_assert (block != NULL);
   g_assert (filesystem != NULL);
@@ -2285,7 +2285,7 @@ on_generic_menu_item_edit_label (GtkMenuItem *menu_item,
   gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-  label = udisks_block_device_get_id_label (block);
+  label = udisks_block_get_id_label (block);
   g_signal_connect (entry,
                     "changed",
                     G_CALLBACK (on_change_filesystem_label_entry_changed),
@@ -2362,7 +2362,7 @@ on_generic_menu_item_edit_partition (GtkMenuItem *menu_item,
   GtkWidget *dialog;
   GtkWidget *combo_box;
   UDisksObject *object;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   const gchar *scheme;
   const gchar *cur_type;
   const gchar **part_types;
@@ -2373,7 +2373,7 @@ on_generic_menu_item_edit_partition (GtkMenuItem *menu_item,
 
   object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
   g_assert (object != NULL);
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
   g_assert (block != NULL);
 
   dialog = gdu_window_new_widget (window, "change-partition-type-dialog", &builder);
@@ -2381,8 +2381,8 @@ on_generic_menu_item_edit_partition (GtkMenuItem *menu_item,
   gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-  scheme = udisks_block_device_get_part_entry_scheme (block);
-  cur_type = udisks_block_device_get_part_entry_type (block);
+  scheme = udisks_block_get_part_entry_scheme (block);
+  cur_type = udisks_block_get_part_entry_type (block);
   part_types = udisks_util_get_part_types_for_scheme (scheme);
   active_index = -1;
   gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (combo_box));
@@ -2610,14 +2610,14 @@ fstab_on_device_combobox_changed (GtkComboBox *combobox,
 }
 
 static gboolean
-drive_treat_as_removable (UDisksDrive       *drive,
-                          UDisksBlockDevice *block)
+drive_treat_as_removable (UDisksDrive  *drive,
+                          UDisksBlock  *block)
 {
   gboolean ret = FALSE;
   const gchar *device_file;
 
   g_return_val_if_fail (UDISKS_IS_DRIVE (drive), FALSE);
-  g_return_val_if_fail (UDISKS_IS_BLOCK_DEVICE (block), FALSE);
+  g_return_val_if_fail (UDISKS_IS_BLOCK (block), FALSE);
 
   if (udisks_drive_get_media_removable (drive))
     {
@@ -2625,7 +2625,7 @@ drive_treat_as_removable (UDisksDrive       *drive,
       goto out;
     }
 
-  device_file = udisks_block_device_get_device (block);
+  device_file = udisks_block_get_device (block);
   if (g_str_has_prefix (device_file, "/dev/mmcblk"))
     {
       ret = TRUE;
@@ -2639,7 +2639,7 @@ drive_treat_as_removable (UDisksDrive       *drive,
 static void
 fstab_populate_device_combo_box (GtkWidget         *device_combobox,
                                  UDisksDrive       *drive,
-                                 UDisksBlockDevice *block,
+                                 UDisksBlock       *block,
                                  const gchar       *fstab_device)
 {
   const gchar *device;
@@ -2660,7 +2660,7 @@ fstab_populate_device_combo_box (GtkWidget         *device_combobox,
   num_items = 0;
   selected = -1;
 
-  device = udisks_block_device_get_device (block);
+  device = udisks_block_get_device (block);
   gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (device_combobox),
                              NULL,
                              device);
@@ -2668,7 +2668,7 @@ fstab_populate_device_combo_box (GtkWidget         *device_combobox,
     selected = num_items;
   num_items = 1;
 
-  symlinks = udisks_block_device_get_symlinks (block);
+  symlinks = udisks_block_get_symlinks (block);
   for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
     {
       gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (device_combobox), NULL, symlinks[n]);
@@ -2687,7 +2687,7 @@ fstab_populate_device_combo_box (GtkWidget         *device_combobox,
       num_items++;
     }
 
-  uuid = udisks_block_device_get_id_uuid (block);
+  uuid = udisks_block_get_id_uuid (block);
   if (uuid != NULL && strlen (uuid) > 0)
     {
       s = g_strdup_printf ("UUID=%s", uuid);
@@ -2698,7 +2698,7 @@ fstab_populate_device_combo_box (GtkWidget         *device_combobox,
       num_items++;
     }
 
-  label = udisks_block_device_get_id_label (block);
+  label = udisks_block_get_id_label (block);
   if (label != NULL && strlen (label) > 0)
     {
       s = g_strdup_printf ("LABEL=%s", label);
@@ -2782,7 +2782,7 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
   GduWindow *window = GDU_WINDOW (user_data);
   GtkBuilder *builder;
   UDisksObject *object;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   UDisksObject *drive_object;
   UDisksDrive *drive;
   gint response;
@@ -2802,13 +2802,13 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
 
   object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
   if (object == NULL)
-    object = gdu_volume_grid_get_block_device (GDU_VOLUME_GRID (window->volume_grid));
-  block = udisks_object_peek_block_device (object);
+    object = gdu_volume_grid_get_block_object (GDU_VOLUME_GRID (window->volume_grid));
+  block = udisks_object_peek_block (object);
   g_assert (block != NULL);
 
   drive = NULL;
   drive_object = (UDisksObject *) g_dbus_object_manager_get_object (udisks_client_get_object_manager (window->client),
-                                                                    udisks_block_device_get_drive (block));
+                                                                    udisks_block_get_drive (block));
   if (drive_object != NULL)
     {
       drive = udisks_object_peek_drive (drive_object);
@@ -2833,7 +2833,7 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
   data.passno_spinbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-passno-spinbutton"));
 
   /* there could be multiple fstab entries - we only consider the first one */
-  g_variant_iter_init (&iter, udisks_block_device_get_configuration (block));
+  g_variant_iter_init (&iter, udisks_block_get_configuration (block));
   while (g_variant_iter_next (&iter, "(&s a{sv})", &configuration_type, &configuration_dict))
     {
       if (g_strcmp0 (configuration_type, "fstab") == 0)
@@ -2980,11 +2980,11 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
       if (old_item != NULL && new_item == NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_remove_configuration_item_sync (block,
-                                                                        old_item,
-                                                                        g_variant_new ("a{sv}", NULL), /* options */
-                                                                        NULL, /* GCancellable */
-                                                                        &error))
+          if (!udisks_block_call_remove_configuration_item_sync (block,
+                                                                 old_item,
+                                                                 g_variant_new ("a{sv}", NULL), /* options */
+                                                                 NULL, /* GCancellable */
+                                                                 &error))
             {
               gdu_window_show_error (window,
                                      _("Error removing old /etc/fstab entry"),
@@ -2997,7 +2997,7 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
       else if (old_item == NULL && new_item != NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_add_configuration_item_sync (block,
+          if (!udisks_block_call_add_configuration_item_sync (block,
                                                                      new_item,
                                                                      g_variant_new ("a{sv}", NULL), /* options */
                                                                      NULL, /* GCancellable */
@@ -3014,12 +3014,12 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
       else if (old_item != NULL && new_item != NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_update_configuration_item_sync (block,
-                                                                        old_item,
-                                                                        new_item,
-                                                                        g_variant_new ("a{sv}", NULL), /* options */
-                                                                        NULL, /* GCancellable */
-                                                                        &error))
+          if (!udisks_block_call_update_configuration_item_sync (block,
+                                                                 old_item,
+                                                                 new_item,
+                                                                 g_variant_new ("a{sv}", NULL), /* options */
+                                                                 NULL, /* GCancellable */
+                                                                 &error))
             {
               gdu_window_show_error (window,
                                      _("Error updating /etc/fstab entry"),
@@ -3051,7 +3051,7 @@ on_generic_menu_item_configure_fstab (GtkMenuItem *menu_item,
 typedef struct
 {
   UDisksDrive *drive;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
 
   GduWindow *window;
 
@@ -3213,7 +3213,7 @@ crypttab_dialog_present (CrypttabDialogData *data)
   else
     {
       configured = FALSE;
-      name = g_strdup_printf ("luks-%s", udisks_block_device_get_id_uuid (data->block));
+      name = g_strdup_printf ("luks-%s", udisks_block_get_id_uuid (data->block));
       options = "";
       /* propose noauto if the media is removable - otherwise e.g. systemd will time out at boot */
       if (data->drive != NULL && drive_treat_as_removable (data->drive, data->block))
@@ -3292,7 +3292,7 @@ crypttab_dialog_present (CrypttabDialogData *data)
           GVariantBuilder builder;
           gchar *s;
           g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
-          s = g_strdup_printf ("UUID=%s", udisks_block_device_get_id_uuid (data->block));
+          s = g_strdup_printf ("UUID=%s", udisks_block_get_id_uuid (data->block));
           g_variant_builder_add (&builder, "{sv}", "device", g_variant_new_bytestring (s));
           g_free (s);
           g_variant_builder_add (&builder, "{sv}", "name", g_variant_new_bytestring (ui_name));
@@ -3330,11 +3330,11 @@ crypttab_dialog_present (CrypttabDialogData *data)
       if (old_item != NULL && new_item == NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_remove_configuration_item_sync (data->block,
-                                                                        old_item,
-                                                                        g_variant_new ("a{sv}", NULL), /* options */
-                                                                        NULL, /* GCancellable */
-                                                                        &error))
+          if (!udisks_block_call_remove_configuration_item_sync (data->block,
+                                                                 old_item,
+                                                                 g_variant_new ("a{sv}", NULL), /* options */
+                                                                 NULL, /* GCancellable */
+                                                                 &error))
             {
               gdu_window_show_error (data->window,
                                      _("Error removing /etc/crypttab entry"),
@@ -3346,11 +3346,11 @@ crypttab_dialog_present (CrypttabDialogData *data)
       else if (old_item == NULL && new_item != NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_add_configuration_item_sync (data->block,
-                                                                     new_item,
-                                                                     g_variant_new ("a{sv}", NULL), /* options */
-                                                                     NULL, /* GCancellable */
-                                                                     &error))
+          if (!udisks_block_call_add_configuration_item_sync (data->block,
+                                                              new_item,
+                                                              g_variant_new ("a{sv}", NULL), /* options */
+                                                              NULL, /* GCancellable */
+                                                              &error))
             {
               gdu_window_show_error (data->window,
                                      _("Error adding /etc/crypttab entry"),
@@ -3362,12 +3362,12 @@ crypttab_dialog_present (CrypttabDialogData *data)
       else if (old_item != NULL && new_item != NULL)
         {
           error = NULL;
-          if (!udisks_block_device_call_update_configuration_item_sync (data->block,
-                                                                        old_item,
-                                                                        new_item,
-                                                                        g_variant_new ("a{sv}", NULL), /* options */
-                                                                        NULL, /* GCancellable */
-                                                                        &error))
+          if (!udisks_block_call_update_configuration_item_sync (data->block,
+                                                                 old_item,
+                                                                 new_item,
+                                                                 g_variant_new ("a{sv}", NULL), /* options */
+                                                                 NULL, /* GCancellable */
+                                                                 &error))
             {
               gdu_window_show_error (data->window,
                                      _("Error updating /etc/crypttab entry"),
@@ -3388,7 +3388,7 @@ crypttab_dialog_present (CrypttabDialogData *data)
 }
 
 static void
-crypttab_dialog_on_get_secrets_cb (UDisksBlockDevice *block,
+crypttab_dialog_on_get_secrets_cb (UDisksBlock       *block,
                                    GAsyncResult      *res,
                                    gpointer           user_data)
 {
@@ -3401,10 +3401,10 @@ crypttab_dialog_on_get_secrets_cb (UDisksBlockDevice *block,
 
   configuration = NULL;
   error = NULL;
-  if (!udisks_block_device_call_get_secret_configuration_finish (block,
-                                                                 &configuration,
-                                                                 res,
-                                                                 &error))
+  if (!udisks_block_call_get_secret_configuration_finish (block,
+                                                          &configuration,
+                                                          res,
+                                                          &error))
     {
       gdu_window_show_error (data->window,
                              _("Error retrieving configuration data"),
@@ -3458,13 +3458,13 @@ on_generic_menu_item_configure_crypttab (GtkMenuItem *menu_item,
 
   object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
   if (object == NULL)
-    object = gdu_volume_grid_get_block_device (GDU_VOLUME_GRID (window->volume_grid));
-  data->block = udisks_object_peek_block_device (object);
+    object = gdu_volume_grid_get_block_object (GDU_VOLUME_GRID (window->volume_grid));
+  data->block = udisks_object_peek_block (object);
   g_assert (data->block != NULL);
 
   data->drive = NULL;
   drive_object = (UDisksObject *) g_dbus_object_manager_get_object (udisks_client_get_object_manager (window->client),
-                                                                    udisks_block_device_get_drive (data->block));
+                                                                    udisks_block_get_drive (data->block));
   if (drive_object != NULL)
     {
       data->drive = udisks_object_peek_drive (drive_object);
@@ -3488,7 +3488,7 @@ on_generic_menu_item_configure_crypttab (GtkMenuItem *menu_item,
   /* First check if there's an existing configuration */
   configured = FALSE;
   get_passphrase_contents = FALSE;
-  g_variant_iter_init (&iter, udisks_block_device_get_configuration (data->block));
+  g_variant_iter_init (&iter, udisks_block_get_configuration (data->block));
   while (g_variant_iter_next (&iter, "(&s a{sv})", &configuration_type, &configuration_dict))
     {
       if (g_strcmp0 (configuration_type, "crypttab") == 0)
@@ -3518,11 +3518,11 @@ on_generic_menu_item_configure_crypttab (GtkMenuItem *menu_item,
    */
   if (configured && get_passphrase_contents)
     {
-      udisks_block_device_call_get_secret_configuration (data->block,
-                                                         g_variant_new ("a{sv}", NULL), /* options */
-                                                         NULL, /* cancellable */
-                                                         (GAsyncReadyCallback) crypttab_dialog_on_get_secrets_cb,
-                                                         data);
+      udisks_block_call_get_secret_configuration (data->block,
+                                                  g_variant_new ("a{sv}", NULL), /* options */
+                                                  NULL, /* cancellable */
+                                                  (GAsyncReadyCallback) crypttab_dialog_on_get_secrets_cb,
+                                                  data);
     }
   else
     {
@@ -3705,7 +3705,7 @@ on_devtab_action_unlock_activated (GtkAction *action,
   GtkWidget *entry;
   GtkWidget *show_passphrase_check_button;
   UDisksObject *object;
-  UDisksBlockDevice *block;
+  UDisksBlock *block;
   UDisksEncrypted *encrypted;
   const gchar *passphrase;
   gboolean has_passphrase;
@@ -3716,7 +3716,7 @@ on_devtab_action_unlock_activated (GtkAction *action,
   /* TODO: look up passphrase from gnome-keyring? */
 
   object = gdu_volume_grid_get_selected_device (GDU_VOLUME_GRID (window->volume_grid));
-  block = udisks_object_peek_block_device (object);
+  block = udisks_object_peek_block (object);
   encrypted = udisks_object_peek_encrypted (object);
 
   passphrase = "";



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]