[gnome-color-manager] Allow virtual devices to have a serial number



commit 2a52c0c05730070287cbbea715da30f209cebf6d
Author: Richard Hughes <richard hughsie com>
Date:   Fri May 21 15:00:29 2010 +0100

    Allow virtual devices to have a serial number

 src/gcm-device-virtual.c |    2 ++
 src/gcm-device-virtual.h |    5 +++--
 src/gcm-prefs.c          |    6 ++++--
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-device-virtual.c b/src/gcm-device-virtual.c
index 0179fd7..c79e990 100644
--- a/src/gcm-device-virtual.c
+++ b/src/gcm-device-virtual.c
@@ -41,6 +41,7 @@ gcm_device_virtual_create_from_params (GcmDeviceVirtual *device_virtual,
 				       GcmDeviceKind	 device_kind,
 				       const gchar      *model,
 				       const gchar      *manufacturer,
+				       const gchar      *serial,
 				       GcmColorspace	 colorspace)
 {
 	gchar *id;
@@ -59,6 +60,7 @@ gcm_device_virtual_create_from_params (GcmDeviceVirtual *device_virtual,
 		      "id", id,
 		      "manufacturer", manufacturer,
 		      "model", model,
+		      "serial", serial,
 		      "title", title,
 		      "colorspace", colorspace,
 		      "virtual", TRUE,
diff --git a/src/gcm-device-virtual.h b/src/gcm-device-virtual.h
index 237f250..c69f275 100644
--- a/src/gcm-device-virtual.h
+++ b/src/gcm-device-virtual.h
@@ -49,10 +49,11 @@ struct _GcmDeviceVirtualClass
 GType		 gcm_device_virtual_get_type		  	(void);
 GcmDevice	*gcm_device_virtual_new				(void);
 gboolean	 gcm_device_virtual_create_from_params		(GcmDeviceVirtual	*device_virtual,
-								 GcmDeviceKind	 device_kind,
+								 GcmDeviceKind		 device_kind,
 								 const gchar		*model,
 								 const gchar		*manufacturer,
-								 GcmColorspace	 colorspace);
+								 const gchar		*serial,
+								 GcmColorspace		 colorspace);
 
 G_END_DECLS
 
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index bdbc5f8..1c8ff9b 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -620,7 +620,7 @@ gcm_prefs_profile_add_virtual_file (GFile *file)
 						     gcm_exif_get_device_kind (exif),
 						     gcm_exif_get_model (exif),
 						     gcm_exif_get_manufacturer (exif),
-						     /* FIXME: serial?! */
+						     gcm_exif_get_serial (exif),
 						     GCM_COLORSPACE_RGB);
 	if (!ret) {
 		/* TRANSLATORS: could not add virtual device */
@@ -1030,7 +1030,9 @@ gcm_prefs_button_virtual_add_cb (GtkWidget *widget, gpointer data)
 
 	/* create device */
 	device = gcm_device_virtual_new	();
-	ret = gcm_device_virtual_create_from_params (GCM_DEVICE_VIRTUAL (device), device_kind, model, manufacturer, GCM_COLORSPACE_RGB);
+	ret = gcm_device_virtual_create_from_params (GCM_DEVICE_VIRTUAL (device),
+						     device_kind, model, manufacturer,
+						     NULL, GCM_COLORSPACE_RGB);
 	if (!ret) {
 		/* TRANSLATORS: could not add virtual device */
 		gcm_prefs_error_dialog (_("Failed to create virtual device"), NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]