[gnome-disk-utility/udisks2-port] Catch up with latest udisks2 changes
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Catch up with latest udisks2 changes
- Date: Tue, 29 Mar 2011 18:23:56 +0000 (UTC)
commit 9ccac2f2d4c6158c47451b81854c89c357c9ceb3
Author: David Zeuthen <davidz redhat com>
Date: Tue Mar 29 14:23:45 2011 -0400
Catch up with latest udisks2 changes
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gdudevicetreemodel.c | 7 +++++--
src/palimpsest/gduwindow.c | 20 +++++++++++++++-----
2 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/palimpsest/gdudevicetreemodel.c b/src/palimpsest/gdudevicetreemodel.c
index a7eb9a6..f7147d9 100644
--- a/src/palimpsest/gdudevicetreemodel.c
+++ b/src/palimpsest/gdudevicetreemodel.c
@@ -467,12 +467,13 @@ add_lun (GduDeviceTreeModel *model,
GIcon *media_icon;
gchar *name;
gchar *description;
+ gchar *media_description;
gchar *s;
gchar *sort_key;
GtkTreeIter iter;
lun = UDISKS_PEEK_LUN (object);
- udisks_util_get_lun_info (lun, &name, &description, &drive_icon, &media_icon);
+ udisks_util_get_lun_info (lun, &name, &description, &drive_icon, &media_description, &media_icon);
s = g_strdup_printf ("%s\n"
"<small><span foreground=\"#555555\">%s</span></small>",
description,
@@ -496,10 +497,12 @@ add_lun (GduDeviceTreeModel *model,
GDU_DEVICE_TREE_MODEL_COLUMN_SORT_KEY, sort_key,
GDU_DEVICE_TREE_MODEL_COLUMN_OBJECT, object,
-1);
- g_object_unref (media_icon);
+ if (media_icon != NULL)
+ g_object_unref (media_icon);
g_object_unref (drive_icon);
g_free (sort_key);
g_free (s);
+ g_free (media_description);
g_free (description);
g_free (name);
}
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index f5c1c7a..03f8a9e 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -948,6 +948,7 @@ setup_device_page (GduWindow *window,
gchar *lun_name;
gchar *lun_desc;
GIcon *lun_icon;
+ gchar *lun_media_desc;
GIcon *lun_media_icon;
/* TODO: for multipath, ensure e.g. mpathk is before sda, sdb */
@@ -958,6 +959,7 @@ setup_device_page (GduWindow *window,
&lun_name,
&lun_desc,
&lun_icon,
+ &lun_media_desc,
&lun_media_icon);
if (block_devices != NULL)
gdu_volume_grid_set_block_device (GDU_VOLUME_GRID (window->volume_grid), block_devices->data);
@@ -967,7 +969,9 @@ setup_device_page (GduWindow *window,
g_free (lun_name);
g_free (lun_desc);
g_object_unref (lun_icon);
- g_object_unref (lun_media_icon);
+ g_free (lun_media_desc);
+ if (lun_media_icon != NULL)
+ g_object_unref (lun_media_icon);
g_list_foreach (block_devices, (GFunc) g_object_unref, NULL);
g_list_free (block_devices);
@@ -999,6 +1003,7 @@ update_device_page_for_lun (GduWindow *window,
gchar *media_compat_for_display;
gchar *name;
gchar *description;
+ gchar *media_description;
GIcon *drive_icon;
GIcon *media_icon;
GtkWidget *w;
@@ -1012,7 +1017,7 @@ update_device_page_for_lun (GduWindow *window,
block_devices = get_top_level_block_devices_for_lun (window, g_dbus_object_get_object_path (object));
block_devices = g_list_sort (block_devices, (GCompareFunc) block_device_compare_on_preferred);
- udisks_util_get_lun_info (lun, &name, &description, &drive_icon, &media_icon);
+ udisks_util_get_lun_info (lun, &name, &description, &drive_icon, &media_description, &media_icon);
lun_vendor = udisks_lun_get_vendor (lun);
lun_model = udisks_lun_get_model (lun);
@@ -1034,7 +1039,7 @@ update_device_page_for_lun (GduWindow *window,
}
s = g_strdup_printf ("<big><b>%s</b></big>\n"
"<small><span foreground=\"#555555\">%s</span></small>",
- description,
+ media_description != NULL ? media_description : description,
str->str);
g_string_free (str, TRUE);
w = gdu_window_get_widget (window, "devtab-drive-value-label");
@@ -1042,7 +1047,10 @@ update_device_page_for_lun (GduWindow *window,
gtk_widget_show (w);
g_free (s);
w = gdu_window_get_widget (window, "devtab-drive-image");
- gtk_image_set_from_gicon (GTK_IMAGE (w), media_icon, GTK_ICON_SIZE_DIALOG);
+ if (media_icon != NULL)
+ gtk_image_set_from_gicon (GTK_IMAGE (w), media_icon, GTK_ICON_SIZE_DIALOG);
+ else
+ gtk_image_set_from_gicon (GTK_IMAGE (w), drive_icon, GTK_ICON_SIZE_DIALOG);
gtk_widget_show (w);
if (strlen (lun_vendor) == 0)
@@ -1109,9 +1117,11 @@ update_device_page_for_lun (GduWindow *window,
g_free (media_for_display);
g_list_foreach (block_devices, (GFunc) g_object_unref, NULL);
g_list_free (block_devices);
- g_object_unref (media_icon);
+ if (media_icon != NULL)
+ g_object_unref (media_icon);
g_object_unref (drive_icon);
g_free (description);
+ g_free (media_description);
g_free (name);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]