brasero r1084 - in trunk: . src



Author: philippr
Date: Thu Aug 14 11:40:32 2008
New Revision: 1084
URL: http://svn.gnome.org/viewvc/brasero?rev=1084&view=rev

Log:
	Attempt at fixing #547742 â brasero crashed with SIGSEGV in brasero_medium_get_write_speeds()
	New string to tell users speed retrieval didn\'t work.

	* src/brasero-drive-properties.c
	(brasero_drive_properties_set_drive):
	* src/burn-medium.c (brasero_medium_get_write_speeds):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-drive-properties.c
   trunk/src/burn-medium.c

Modified: trunk/src/brasero-drive-properties.c
==============================================================================
--- trunk/src/brasero-drive-properties.c	(original)
+++ trunk/src/brasero-drive-properties.c	Thu Aug 14 11:40:32 2008
@@ -376,7 +376,6 @@
 	GtkTreeModel *model;
 	gchar *display_name;
 	GtkTreeIter iter;
-	gchar *max_text;
 	gint64 *rates;
 	gchar *header;
 	gchar *text;
@@ -398,14 +397,22 @@
 	rates = brasero_medium_get_write_speeds (medium);
 	model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->speed));
 
-	max_text = g_strdup_printf (_("Max speed"));
+	if (!rates) {
+		gtk_widget_set_sensitive (priv->speed, FALSE);
+		gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+				    PROP_TEXT, _("Impossible to retrieve speeds"),
+				    PROP_RATE, 1764, /* Speed 1 */
+				    -1);
+		gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->speed), &iter);
+		return;
+	}
 
 	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
 	gtk_list_store_set (GTK_LIST_STORE (model), &iter,
-			    PROP_TEXT, max_text,
+			    PROP_TEXT, _("Max speed"),
 			    PROP_RATE, rates [0],
 			    -1);
-	g_free (max_text);
 
 	/* fill model */
 	for (i = 0; rates [i] != 0; i ++) {

Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c	(original)
+++ trunk/src/burn-medium.c	Thu Aug 14 11:40:32 2008
@@ -388,6 +388,9 @@
 
 	priv = BRASERO_MEDIUM_PRIVATE (medium);
 
+	if (!priv->wr_speeds)
+		return NULL;
+
 	while (priv->wr_speeds [max] != 0) max ++;
 
 	speeds = g_new0 (gint64, max + 1);



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