From 2c38b12b12b1e7af0b94041f0584f0568c806e35 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sun, 22 Feb 2009 11:12:34 -0500 Subject: [PATCH] only report media type if media is actually available --- src/devkit-disks-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/devkit-disks-device.c b/src/devkit-disks-device.c index 2814dce..d96c05a 100644 --- a/src/devkit-disks-device.c +++ b/src/devkit-disks-device.c @@ -2493,8 +2493,9 @@ update_info (DevkitDisksDevice *device) /* make sure compat media is sorted */ g_ptr_array_sort (device->priv->info.drive_media_compatibility, (GCompareFunc) strcmp); - /* if we don't know the media but do know the media compat, just select the first one */ - if (device->priv->info.drive_media == NULL) { + /* if we have have media, but don't know the media but do know the media compat, + * just select the first one */ + if (device->priv->info.device_is_media_available && device->priv->info.drive_media == NULL) { device->priv->info.drive_media = g_strdup (device->priv->info.drive_media_compatibility->pdata[0]); } -- 2.7.4