From 062ec4219d98cbad9a05ad42c1b203fe094c6082 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Mon, 31 Oct 2011 16:28:54 -0400 Subject: [PATCH] Return "Unknown" for unknown partition types Signed-off-by: David Zeuthen --- po/POTFILES.in | 9 ++++++++- udisks/udisksclient.c | 14 ++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 18a074d..76fedde 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,5 +3,12 @@ # Please keep this file sorted alphabetically. policy/org.freedesktop.udisks2.policy.in src/udiskslinuxblock.c +src/udiskslinuxdrive.c +src/udiskslinuxdriveata.c +src/udiskslinuxencrypted.c src/udiskslinuxfilesystem.c -udisks/udisksutil.c +src/udiskslinuxloop.c +src/udiskslinuxmanager.c +src/udiskslinuxpartition.c +src/udiskslinuxswapspace.c +udisks/udisksclient.c diff --git a/udisks/udisksclient.c b/udisks/udisksclient.c index 5d43314..d7975a9 100644 --- a/udisks/udisksclient.c +++ b/udisks/udisksclient.c @@ -1210,7 +1210,7 @@ add_item (gchar **items_str, * user interface in a single line of text. * * The returned string is localized and includes things like the - * partition type and its flags (if any). + * partition type, flags (if any) and name (if any). * * Returns: (transfer full): A string that should be freed with g_free(). */ @@ -1252,21 +1252,27 @@ udisks_client_get_partition_info (UDisksClient *client, type_str = udisks_client_get_partition_type_for_display (client, udisks_partition_table_get_type_ (table), udisks_partition_get_type_ (partition)); + if (type_str == NULL) + type_str = udisks_partition_get_type_ (partition); - /* TODO: also include label? */ if (flags_str != NULL) { - ret = g_strdup_printf ("%s (%s)", type_str, flags_str); + /* Translators: Partition info. First %s is the type, second %s is a list of flags */ + ret = g_strdup_printf (C_("partition-info", "%s (%s)"), type_str, flags_str); } else { ret = g_strdup (type_str); } + if (ret == NULL || strlen (ret) == 0) + { + g_free (ret); + ret = g_strdup (C_("partition-info", "Unknown")); + } g_free (flags_str); g_object_unref (table); - return ret; } -- 2.7.4