[brasero] Improve the previous patch handling xml files slightly better when they are passed on the command li



commit 8e8c00212d19d0227a957856896d70b10e8c01e0
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Aug 26 20:36:31 2009 +0200

    Improve the previous patch handling xml files slightly better when they are passed on the command line

 src/brasero-app.c             |   17 ++++++++++-------
 src/brasero-app.h             |    3 ++-
 src/brasero-project-manager.c |    4 ++--
 src/main.c                    |    2 +-
 4 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/brasero-app.c b/src/brasero-app.c
index aef3f6a..8ca3061 100644
--- a/src/brasero-app.c
+++ b/src/brasero-app.c
@@ -1168,7 +1168,8 @@ brasero_app_open_project (BraseroApp *app,
 static gboolean
 brasero_app_open_by_mime (BraseroApp *app,
                           const gchar *uri,
-                          const gchar *mime)
+                          const gchar *mime,
+                          gboolean warn_user)
 {
 	BraseroAppPrivate *priv;
 
@@ -1183,7 +1184,7 @@ brasero_app_open_by_mime (BraseroApp *app,
 	 * installed, it's returned as application/xml, so check that too. */
 	if (!strcmp (mime, "application/x-brasero")
 	||  !strcmp (mime, "application/xml"))
-		return brasero_app_open_project (app, uri, FALSE, TRUE, FALSE);
+		return brasero_app_open_project (app, uri, FALSE, warn_user, FALSE);
 
 #ifdef BUILD_PLAYLIST
 
@@ -1191,7 +1192,7 @@ brasero_app_open_by_mime (BraseroApp *app,
 	     ||  !strcmp (mime, "audio/x-ms-asx")
 	     ||  !strcmp (mime, "audio/x-mp3-playlist")
 	     ||  !strcmp (mime, "audio/x-mpegurl"))
-		return brasero_app_open_project (app, uri, TRUE,  TRUE, FALSE);
+		return brasero_app_open_project (app, uri, TRUE,  warn_user, FALSE);
 
 #endif
 
@@ -1212,7 +1213,8 @@ brasero_app_open_by_mime (BraseroApp *app,
 
 gboolean
 brasero_app_open_uri (BraseroApp *app,
-                      const gchar *uri_arg)
+                      const gchar *uri_arg,
+                      gboolean warn_user)
 {
 	gchar *uri;
 	GFile *file;
@@ -1287,9 +1289,9 @@ brasero_app_open_uri (BraseroApp *app,
 		const gchar *mime;
 
 		mime = g_file_info_get_content_type (info);
-	  	type = brasero_app_open_by_mime (app, uri, mime);
+	  	type = brasero_app_open_by_mime (app, uri, mime, warn_user);
         } 
-	else {
+	else if (warn_user) {
 		gchar *string;
 
 		string = g_strdup_printf (_("The project \"%s\" does not exist"), uri);
@@ -1350,7 +1352,8 @@ brasero_app_recent_open (GtkRecentChooser *chooser,
 	/* Make sure it is no longer one shot */
 	brasero_app_open_by_mime (app,
 	                          uri,
-	                          mime);
+	                          mime,
+	                          TRUE);
 	gtk_recent_info_unref (item);
 	g_free (uri);
 }
diff --git a/src/brasero-app.h b/src/brasero-app.h
index 49d3293..52f4fc4 100644
--- a/src/brasero-app.h
+++ b/src/brasero-app.h
@@ -120,7 +120,8 @@ brasero_app_open_project (BraseroApp *app,
 
 gboolean
 brasero_app_open_uri (BraseroApp *app,
-                      const gchar *uri_arg);
+                      const gchar *uri_arg,
+                      gboolean warn_user);
 
 GtkWidget *
 brasero_app_get_statusbar1 (BraseroApp *app);
diff --git a/src/brasero-project-manager.c b/src/brasero-project-manager.c
index bc575df..4c4b420 100644
--- a/src/brasero-project-manager.c
+++ b/src/brasero-project-manager.c
@@ -810,7 +810,7 @@ brasero_project_manager_open_cb (GtkAction *action, BraseroProjectManager *manag
 	uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (chooser));
 	gtk_widget_destroy (chooser);
 
-	brasero_app_open_uri (brasero_app_get_default (), uri);
+	brasero_app_open_uri (brasero_app_get_default (), uri, TRUE);
 	g_free (uri);
 }
 
@@ -819,7 +819,7 @@ brasero_project_manager_recent_clicked_cb (BraseroProjectTypeChooser *chooser,
 					   const gchar *uri,
 					   BraseroProjectManager *manager)
 {
-	brasero_app_open_uri (brasero_app_get_default (), uri);
+	brasero_app_open_uri (brasero_app_get_default (), uri, TRUE);
 }
 
 void
diff --git a/src/main.c b/src/main.c
index ae1aa20..abd31b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -407,7 +407,7 @@ brasero_app_parse_options (BraseroApp *app)
 	}
 	else if (files) {
 		if (g_strv_length (files) == 1
-		&&  brasero_app_open_uri (app, files [0]))
+		&&  brasero_app_open_uri (app, files [0], FALSE))
 			return;
 
 		brasero_app_create_mainwin (app);



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