[brasero] Fix broken multisession with data projects
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Subject: [brasero] Fix broken multisession with data projects
- Date: Tue, 14 Jul 2009 18:20:08 +0000 (UTC)
commit c7643af6288e3bb3f2f94a52b68ec1e5cdfc8fdb
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Tue Jul 14 20:17:12 2009 +0200
Fix broken multisession with data projects
The BraseroDataDisc object wrongly unloaded the selected medium just before burning
src/brasero-data-disc.c | 55 ++++++++++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 22 deletions(-)
---
diff --git a/src/brasero-data-disc.c b/src/brasero-data-disc.c
index 90fa37e..a1b5822 100644
--- a/src/brasero-data-disc.c
+++ b/src/brasero-data-disc.c
@@ -1054,6 +1054,31 @@ brasero_data_disc_import_button_new (BraseroDataDisc *self,
}
static void
+brasero_data_disc_remove_available_medium (BraseroDataDisc *self,
+ BraseroMedium *medium)
+{
+ int merge_id;
+ GtkAction *action;
+ gchar *action_name;
+ BraseroDataDiscPrivate *priv;
+
+ priv = BRASERO_DATA_DISC_PRIVATE (self);
+
+ action_name = g_strdup_printf ("Import_%s", BRASERO_MEDIUM_GET_UDI (medium));
+ action = gtk_action_group_get_action (priv->import_group, action_name);
+ g_free (action_name);
+
+ brasero_notify_message_remove (BRASERO_NOTIFY (priv->message), BRASERO_NOTIFY_CONTEXT_MULTISESSION);
+
+ merge_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), BRASERO_DATA_DISC_MERGE_ID));
+ gtk_ui_manager_remove_ui (priv->manager, merge_id);
+ gtk_action_group_remove_action (priv->import_group, action);
+
+ /* unref it since we reffed it when it was associated with the action */
+ g_object_unref (medium);
+}
+
+static void
brasero_data_disc_session_available_cb (BraseroTrackDataCfg *session,
BraseroMedium *medium,
gboolean available,
@@ -1106,24 +1131,8 @@ brasero_data_disc_session_available_cb (BraseroTrackDataCfg *session,
G_CALLBACK (brasero_disc_disc_session_import_response_cb),
self);
}
- else {
- int merge_id;
- GtkAction *action;
- gchar *action_name;
-
- action_name = g_strdup_printf ("Import_%s", BRASERO_MEDIUM_GET_UDI (medium));
- action = gtk_action_group_get_action (priv->import_group, action_name);
- g_free (action_name);
-
- brasero_notify_message_remove (BRASERO_NOTIFY (priv->message), BRASERO_NOTIFY_CONTEXT_MULTISESSION);
-
- merge_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), BRASERO_DATA_DISC_MERGE_ID));
- gtk_ui_manager_remove_ui (priv->manager, merge_id);
- gtk_action_group_remove_action (priv->import_group, action);
-
- /* unref it since we reffed it when it was associated with the action */
- g_object_unref (medium);
- }
+ else
+ brasero_data_disc_remove_available_medium (self, medium);
}
static void
@@ -1431,6 +1440,7 @@ static void
brasero_data_disc_unset_track (BraseroDataDisc *disc)
{
BraseroDataDiscPrivate *priv;
+ BraseroMedium *medium;
priv = BRASERO_DATA_DISC_PRIVATE (disc);
@@ -1450,10 +1460,6 @@ brasero_data_disc_unset_track (BraseroDataDisc *disc)
priv->filter = NULL;
}
- /* Unload session */
- if (brasero_track_data_cfg_get_current_medium (BRASERO_TRACK_DATA_CFG (priv->project)))
- brasero_track_data_cfg_unload_current_medium (BRASERO_TRACK_DATA_CFG (priv->project));
-
if (priv->size_changed_id) {
g_source_remove (priv->size_changed_id);
priv->size_changed_id = 0;
@@ -1512,6 +1518,11 @@ brasero_data_disc_unset_track (BraseroDataDisc *disc)
brasero_data_disc_session_loaded_cb,
disc);
+ /* Unload session */
+ medium = brasero_track_data_cfg_get_current_medium (BRASERO_TRACK_DATA_CFG (priv->project));
+ if (medium)
+ brasero_data_disc_remove_available_medium (disc, medium);
+
g_object_unref (priv->project);
priv->project = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]