[gnome-disk-utility] Handle the case where we don't know the contents of a block device
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Handle the case where we don't know the contents of a block device
- Date: Mon, 26 Nov 2012 18:01:02 +0000 (UTC)
commit 60f87100a84fe66b26bee1163360e0cd395839b0
Author: David Zeuthen <zeuthen gmail com>
Date: Mon Nov 26 12:59:42 2012 -0500
Handle the case where we don't know the contents of a block device
Otherwise we show "(null) - Not Mounted" for PC floppy drives (/dev/fd0)
which is not right.
Signed-off-by: David Zeuthen <zeuthen gmail com>
src/disks/gduwindow.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index 0c13f11..fc614cd 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -3177,12 +3177,19 @@ update_device_page_for_block (GduWindow *window,
if (in_use_markup != NULL)
{
- /* Translators: Shown in 'Contents' field for a member that can be "mounted" (e.g. filesystem or swap area).
- * The first %s is the usual contents string e.g. "Swapspace" or "Ext4 (version 1.0)".
- * The second %s is either "Mounted at /path/to/fs", "Not Mounted, "Active", "Not Active", "Unlocked" or "Locked".
- */
- s2 = g_strdup_printf (C_("volume-contents-combiner", "%s â %s"), s, in_use_markup);
- g_free (s); s = s2;
+ if (s != NULL)
+ {
+ /* Translators: Shown in 'Contents' field for a member that can be "mounted" (e.g. filesystem or swap area).
+ * The first %s is the usual contents string e.g. "Swapspace" or "Ext4 (version 1.0)".
+ * The second %s is either "Mounted at /path/to/fs", "Not Mounted, "Active", "Not Active", "Unlocked" or "Locked".
+ */
+ s2 = g_strdup_printf (C_("volume-contents-combiner", "%s â %s"), s, in_use_markup);
+ g_free (s); s = s2;
+ }
+ else
+ {
+ s = in_use_markup; in_use_markup = NULL;
+ }
}
set_markup (window,
"devtab-volume-type-label",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]