[brasero] Remove brasero_drive_new () as we don't need it



commit 876f73a11e0f7dd67ebb946f038a09e1e56a929c
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon Jul 6 21:41:57 2009 +0200

    Remove brasero_drive_new () as we don't need it
    Make UDI property writable at construction time again

 libbrasero-media/brasero-drive.c          |   17 ++++-------------
 libbrasero-media/brasero-medium-monitor.c |   15 +++++++++------
 2 files changed, 13 insertions(+), 19 deletions(-)
---
diff --git a/libbrasero-media/brasero-drive.c b/libbrasero-media/brasero-drive.c
index bc61b64..acf7011 100644
--- a/libbrasero-media/brasero-drive.c
+++ b/libbrasero-media/brasero-drive.c
@@ -854,6 +854,9 @@ brasero_drive_set_property (GObject *object,
 
 	switch (prop_id)
 	{
+	case PROP_UDI:
+		priv->udi = g_strdup (g_value_get_string (value));
+		break;
 	case PROP_GDRIVE:
 		priv->gdrive = g_value_get_object (value);
 		if (!priv->gdrive) {
@@ -994,7 +997,7 @@ brasero_drive_class_init (BraseroDriveClass *klass)
 	                                                     "HAL udi",
 	                                                     "HAL udi as a string",
 	                                                     NULL,
-	                                                     G_PARAM_READABLE));
+	                                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 	g_object_class_install_property (object_class,
 	                                 PROP_GDRIVE,
 	                                 g_param_spec_object ("gdrive",
@@ -1003,15 +1006,3 @@ brasero_drive_class_init (BraseroDriveClass *klass)
 	                                                      G_TYPE_DRIVE,
 	                                                     G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 }
-
-/**
- * This is not public API. Declared in burn-monitor.h.
- */
-
-BraseroDrive *
-brasero_drive_new (GDrive *gdrive)
-{
-	return g_object_new (BRASERO_TYPE_DRIVE,
-			     "gdrive", gdrive,
-			     NULL);
-}
diff --git a/libbrasero-media/brasero-medium-monitor.c b/libbrasero-media/brasero-medium-monitor.c
index c90514a..3cbb16c 100644
--- a/libbrasero-media/brasero-medium-monitor.c
+++ b/libbrasero-media/brasero-medium-monitor.c
@@ -84,9 +84,6 @@ G_DEFINE_TYPE (BraseroMediumMonitor, brasero_medium_monitor, G_TYPE_OBJECT);
  * here.
  */
 
-BraseroDrive *
-brasero_drive_new (GDrive *drive);
-
 gboolean
 brasero_drive_probing (BraseroDrive *drive);
 
@@ -381,7 +378,10 @@ brasero_medium_monitor_inserted_cb (BraseroHALWatch *watch,
 	gdrive = brasero_medium_monitor_get_gdrive (self, device_path);
 	g_free (device_path);
 
-	drive = brasero_drive_new (gdrive);
+	drive = g_object_new (BRASERO_TYPE_DRIVE,
+	                      "udi", udi,
+	                      "gdrive", gdrive,
+	                      NULL);
 	priv->drives = g_slist_prepend (priv->drives, drive);
 
 	/* connect to signals. This must come before the g_signal_emit () so we
@@ -512,7 +512,10 @@ brasero_medium_monitor_init (BraseroMediumMonitor *object)
 		gdrive = brasero_medium_monitor_get_gdrive (object, device_path);
 		g_free (device_path);
 
-		drive = brasero_drive_new (gdrive);
+		drive = g_object_new (BRASERO_TYPE_DRIVE,
+		                      "udi", devices [i],
+		                      "gdrive", gdrive,
+		                      NULL);
 		priv->drives = g_slist_prepend (priv->drives, drive);
 
 		g_signal_connect (drive,
@@ -527,7 +530,7 @@ brasero_medium_monitor_init (BraseroMediumMonitor *object)
 	libhal_free_string_array (devices);
 
 	/* add fake/file drive */
-	drive = brasero_drive_new (NULL);
+	drive = g_object_new (BRASERO_TYPE_DRIVE, NULL);
 	priv->drives = g_slist_prepend (priv->drives, drive);
 
 	return;



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