[gnome-disk-utility/udisks2-port] Use new udisks properties IsContainer/IsContained properties
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Use new udisks properties IsContainer/IsContained properties
- Date: Mon, 24 Oct 2011 17:00:05 +0000 (UTC)
commit 45122e2ee385ef87f1817ad2633d77c2a548dd04
Author: David Zeuthen <davidz redhat com>
Date: Mon Oct 24 12:59:26 2011 -0400
Use new udisks properties IsContainer/IsContained properties
... this way we don't need special-casing of DOS partition tables.
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gduvolumegrid.c | 30 ++++++++----------------------
src/palimpsest/gduwindow.c | 7 +------
2 files changed, 9 insertions(+), 28 deletions(-)
---
diff --git a/src/palimpsest/gduvolumegrid.c b/src/palimpsest/gduvolumegrid.c
index e277c58..b5e0956 100644
--- a/src/palimpsest/gduvolumegrid.c
+++ b/src/palimpsest/gduvolumegrid.c
@@ -1752,24 +1752,15 @@ recompute_grid (GduVolumeGrid *grid)
g_strcmp0 (udisks_partition_get_table (partition), top_object_path) == 0)
{
is_logical = FALSE;
- if (g_strcmp0 (udisks_partition_table_get_type_ (partition_table), "dos") == 0)
+ if (udisks_partition_get_is_contained (partition))
{
- if (udisks_partition_get_number (partition) >= 5)
- {
- is_logical = TRUE;
- }
- else
- {
- gint type;
- type = strtol (udisks_partition_get_type_ (partition), NULL, 0);
- if (type == 0x05 || type == 0x0f || type == 0x85)
- {
- g_warn_if_fail (extended_partition == NULL);
- extended_partition = object;
- }
- }
+ is_logical = TRUE;
+ }
+ else if (udisks_partition_get_is_container (partition))
+ {
+ g_warn_if_fail (extended_partition == NULL);
+ extended_partition = object;
}
-
if (is_logical)
logical_partitions = g_list_prepend (logical_partitions, object);
else
@@ -1954,7 +1945,6 @@ grid_element_set_details (GduVolumeGrid *grid,
const gchar *type;
const gchar *version;
const gchar *label;
- gint partition_type;
gchar *type_for_display;
UDisksFilesystem *filesystem;
UDisksPartition *partition;
@@ -1968,15 +1958,11 @@ grid_element_set_details (GduVolumeGrid *grid,
type = udisks_block_get_id_type (block);
version = udisks_block_get_id_version (block);
label = udisks_block_get_id_label (block);
- partition_type = 0;
- if (partition != NULL)
- partition_type = strtol (udisks_partition_get_type_ (partition), NULL, 0);
if (g_variant_n_children (udisks_block_get_configuration (block)) > 0)
element->show_configured = TRUE;
- if (partition != NULL &&
- (partition_type == 0x05 || partition_type == 0x0f || partition_type == 0x85))
+ if (partition != NULL && udisks_partition_get_is_container (partition))
{
s = g_strdup_printf ("%s\n%s",
C_("volume-grid", "Extended Partition"),
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index c8a82cf..bdb9893 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -1723,7 +1723,6 @@ update_device_page_for_block (GduWindow *window,
const gchar *usage;
const gchar *type;
const gchar *version;
- gint partition_type;
gchar *type_for_display;
gchar *configuration_for_display;
UDisksFilesystem *filesystem;
@@ -1780,13 +1779,9 @@ update_device_page_for_block (GduWindow *window,
type = udisks_block_get_id_type (block);
version = udisks_block_get_id_version (block);
- partition_type = 0;
- if (partition != NULL)
- partition_type = strtol (udisks_partition_get_type_ (partition), NULL, 0);
-
if (size > 0)
{
- if (partition_type == 0x05 || partition_type == 0x0f || partition_type == 0x85)
+ if (partition != NULL && udisks_partition_get_is_container (partition))
{
type_for_display = g_strdup (_("Extended Partition"));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]