[gnome-color-manager/colord: 66/72] Set the 'Serial' property for xrandr devices
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager/colord: 66/72] Set the 'Serial' property for xrandr devices
- Date: Tue, 8 Mar 2011 11:28:53 +0000 (UTC)
commit ad613ded6b735a5f25f12206565cb105bf8c5b8f
Author: Richard Hughes <richard hughsie com>
Date: Thu Feb 24 13:27:51 2011 +0000
Set the 'Serial' property for xrandr devices
src/gcm-session.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-session.c b/src/gcm-session.c
index 17c0e47..92e84b1 100644
--- a/src/gcm-session.c
+++ b/src/gcm-session.c
@@ -1107,6 +1107,7 @@ gcm_x11_screen_output_added_cb (GcmX11Screen *screen_,
{
CdDevice *device = NULL;
const gchar *model;
+ const gchar *serial;
const gchar *vendor;
gboolean ret;
GcmEdid *edid;
@@ -1122,7 +1123,6 @@ gcm_x11_screen_output_added_cb (GcmX11Screen *screen_,
goto out;
}
-
/* is this an internal device? */
ret = gcm_utils_output_is_lcd_internal (gcm_x11_output_get_name (output));
if (ret) {
@@ -1135,6 +1135,11 @@ gcm_x11_screen_output_added_cb (GcmX11Screen *screen_,
vendor = gcm_edid_get_vendor_name (edid);
}
+ /* get a serial number if one exists */
+ serial = gcm_edid_get_serial_number (edid);
+ if (serial == NULL)
+ serial = "unknown";
+
g_debug ("output %s added",
gcm_x11_output_get_name (output));
device_props = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -1154,6 +1159,9 @@ gcm_x11_screen_output_added_cb (GcmX11Screen *screen_,
g_hash_table_insert (device_props,
g_strdup ("Model"),
g_strdup (model));
+ g_hash_table_insert (device_props,
+ g_strdup ("Serial"),
+ g_strdup (serial));
device = cd_client_create_device_sync (client,
gcm_x11_output_get_name (output),
CD_OBJECT_SCOPE_TEMPORARY,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]