Commit d8cdae63 authored by Philippe Rouquier's avatar Philippe Rouquier Committed by Philippe Rouquier

Avoid a race condition with dbus. Initialize drive name right from the

2009-02-19  Philippe Rouquier  <ykw@localhost.localdomain>

	Avoid a race condition with dbus. Initialize drive name right from the start
	so we don't use dbus from a thread now.

	* libbrasero-media/brasero-drive.c
	(brasero_drive_get_display_name), (brasero_drive_finalize),
	(brasero_drive_init_real):

svn path=/trunk/; revision=1958
parent d551c770
2009-02-19 Philippe Rouquier <ykw@localhost.localdomain>
Avoid a race condition with dbus. Initialize drive name right from the start
so we don't use dbus from a thread now.
* libbrasero-media/brasero-drive.c
(brasero_drive_get_display_name), (brasero_drive_finalize),
(brasero_drive_init_real):
2009-02-19 Philippe Rouquier <ykw@localhost.localdomain>
reviewed by: <delete if not using a buddy>
......
......@@ -65,6 +65,7 @@ struct _BraseroDrivePrivate
{
BraseroMedium *medium;
BraseroDriveCaps caps;
gchar *name;
gchar *path;
gchar *block_path;
gchar *udi;
......@@ -494,8 +495,6 @@ gchar *
brasero_drive_get_display_name (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
BraseroHALWatch *watch;
LibHalContext *ctx;
g_return_val_if_fail (drive != NULL, NULL);
g_return_val_if_fail (BRASERO_IS_DRIVE (drive), NULL);
......@@ -508,12 +507,7 @@ brasero_drive_get_display_name (BraseroDrive *drive)
return g_strdup (_("Image File"));
}
watch = brasero_hal_watch_get_default ();
ctx = brasero_hal_watch_get_ctx (watch);
return libhal_device_get_property_string (ctx,
priv->udi,
DEVICE_MODEL,
NULL);
return g_strdup (priv->name);
}
/**
......@@ -670,6 +664,12 @@ brasero_drive_finalize (GObject *object)
BraseroDrivePrivate *priv;
priv = BRASERO_DRIVE_PRIVATE (object);
if (priv->name) {
libhal_free_string (priv->name);
priv->name = NULL;
}
if (priv->path) {
libhal_free_string (priv->path);
priv->path = NULL;
......@@ -915,6 +915,11 @@ brasero_drive_init_real (BraseroDrive *drive)
watch = brasero_hal_watch_get_default ();
ctx = brasero_hal_watch_get_ctx (watch);
priv->name = libhal_device_get_property_string (ctx,
priv->udi,
DEVICE_MODEL,
NULL);
priv->path = libhal_device_get_property_string (ctx,
priv->udi,
BLOCK_DEVICE,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment