brasero r1958 - in trunk: . libbrasero-media
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1958 - in trunk: . libbrasero-media
- Date: Thu, 19 Feb 2009 14:35:41 +0000 (UTC)
Author: philippr
Date: Thu Feb 19 14:35:41 2009
New Revision: 1958
URL: http://svn.gnome.org/viewvc/brasero?rev=1958&view=rev
Log:
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):
Modified:
trunk/ChangeLog
trunk/libbrasero-media/brasero-drive.c
Modified: trunk/libbrasero-media/brasero-drive.c
==============================================================================
--- trunk/libbrasero-media/brasero-drive.c (original)
+++ trunk/libbrasero-media/brasero-drive.c Thu Feb 19 14:35:41 2009
@@ -65,6 +65,7 @@
{
BraseroMedium *medium;
BraseroDriveCaps caps;
+ gchar *name;
gchar *path;
gchar *block_path;
gchar *udi;
@@ -494,8 +495,6 @@
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 @@
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 @@
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 @@
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]