[brasero] Fix project loading/saving



commit 986ea1cb408fe8fe585c1b695210ade14c9c1597
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon Jun 22 20:40:50 2009 +0200

    Fix project loading/saving

 src/brasero-project.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/src/brasero-project.c b/src/brasero-project.c
index f03e845..5b38d4b 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -1578,8 +1578,6 @@ brasero_project_switch (BraseroProject *project, BraseroProjectType type)
 {
 	GtkAction *action;
 
-	brasero_project_new_session (project);
-
 	if (type == BRASERO_PROJECT_TYPE_AUDIO) {
 		project->priv->current = BRASERO_DISC (project->priv->audio);
 		gtk_notebook_set_current_page (GTK_NOTEBOOK (project->priv->discs), 0);
@@ -1632,7 +1630,7 @@ brasero_project_switch (BraseroProject *project, BraseroProjectType type)
 void
 brasero_project_set_audio (BraseroProject *project, GSList *uris)
 {
-	brasero_project_reset (project);
+	brasero_project_new_session (project);
 	brasero_project_switch (project, BRASERO_PROJECT_TYPE_AUDIO);
 
 	for (; uris; uris = uris->next) {
@@ -1647,7 +1645,7 @@ void
 brasero_project_set_data (BraseroProject *project,
 			  GSList *uris)
 {
-	brasero_project_reset (project);
+	brasero_project_new_session (project);
 	brasero_project_switch (project, BRASERO_PROJECT_TYPE_DATA);
 
 	for (; uris; uris = uris->next) {
@@ -1661,7 +1659,7 @@ brasero_project_set_data (BraseroProject *project,
 void
 brasero_project_set_video (BraseroProject *project, GSList *uris)
 {
-	brasero_project_reset (project);
+	brasero_project_new_session (project);
 	brasero_project_switch (project, BRASERO_PROJECT_TYPE_VIDEO);
 
 	for (; uris; uris = uris->next) {
@@ -2221,7 +2219,7 @@ brasero_project_open_project_real (BraseroProject *project,
 	GValue *value;
 	BraseroProjectType type;
 
-	brasero_project_reset (project);
+	brasero_project_new_session (project);
 
 #ifdef BUILD_PLAYLIST
 
@@ -2478,6 +2476,9 @@ brasero_project_save_project (BraseroProject *project)
 	gchar *uri = NULL;
 	gboolean result;
 
+	if (!project->priv->session)
+		return FALSE;
+
 	if (!project->priv->project && !(uri = brasero_project_save_project_ask_for_path (project, NULL)))
 		return FALSE;
 
@@ -2494,6 +2495,9 @@ brasero_project_save_project_as (BraseroProject *project)
 	gboolean result;
 	gchar *uri;
 
+	if (!project->priv->session)
+		return FALSE;
+
 	uri = brasero_project_save_project_ask_for_path (project, &type);
 	if (!uri)
 		return FALSE;
@@ -2516,6 +2520,9 @@ brasero_project_save_session (BraseroProject *project,
 			      gchar **saved_uri,
 			      gboolean show_cancel)
 {
+	if (!project->priv->session)
+		return FALSE;
+
 	if (!project->priv->current) {
 		if (saved_uri)
 			*saved_uri = NULL;



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