brasero r1765 - trunk/src



Author: philippr
Date: Sat Jan 17 12:37:12 2009
New Revision: 1765
URL: http://svn.gnome.org/viewvc/brasero?rev=1765&view=rev

Log:
Fixed ChangeLog entry

Modified:
   trunk/src/brasero-session-cfg.c
   trunk/src/burn-caps.c
   trunk/src/burn-process.c

Modified: trunk/src/brasero-session-cfg.c
==============================================================================
--- trunk/src/brasero-session-cfg.c	(original)
+++ trunk/src/brasero-session-cfg.c	Sat Jan 17 12:37:12 2009
@@ -248,6 +248,8 @@
 					      BRASERO_BURN_SESSION (self),
 					      &priv->supported,
 					      &priv->compulsory);
+	BRASERO_BURN_LOG ("Got supported flags %d", result);
+
 	if (result != BRASERO_BURN_OK) {
 		brasero_burn_session_set_flags (BRASERO_BURN_SESSION (self), flags);
 		return;
@@ -671,10 +673,11 @@
 	}
 	else {
 		/* Don't use flags as they'll be adapted later. */
+		BRASERO_BURN_LOG ("Testing media support");
 		result = brasero_burn_caps_is_session_supported (priv->caps,
 								 BRASERO_BURN_SESSION (self),
 								 FALSE);
-
+		BRASERO_BURN_LOG ("Result %i", result);
 		if (result != BRASERO_BURN_OK
 		&&  source.type == BRASERO_TRACK_TYPE_AUDIO
 		&& (source.subtype.audio_format & BRASERO_METADATA_INFO)) {

Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c	(original)
+++ trunk/src/burn-caps.c	Sat Jan 17 12:37:12 2009
@@ -99,6 +99,14 @@
 brasero_medium_supported_flags (BraseroMedium *self,
 				BraseroBurnFlag flags);
 
+/**
+ * This macro is used to determine whether or not blanking could change anything
+ * for the medium so that we can write to it.
+ */
+#define BRASERO_BURN_CAPS_SHOULD_BLANK(media_MACRO, flags_MACRO)		\
+	((media_MACRO & BRASERO_MEDIUM_UNFORMATTED) ||				\
+	((media_MACRO & (BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA)) &&	\
+	 (flags_MACRO & (BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND)) == FALSE))
 
 #define BRASERO_BURN_CAPS_NOT_SUPPORTED_LOG(session)				\
 {										\
@@ -2458,9 +2466,10 @@
 						  supported_flags,
 						  compulsory_flags);
 
-	/* see if we can add BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE */
-	if ((media & (BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA))
-	&& !(session_flags & (BRASERO_BURN_FLAG_MERGE|BRASERO_BURN_FLAG_APPEND))
+	/* see if we can add BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE. Add it when:
+	 * - media can be blanked, it has audio or data and we're not merging
+	 * - media is not formatted and it can be blanked/formatted */
+	if (BRASERO_BURN_CAPS_SHOULD_BLANK (media, session_flags)
 	&&  brasero_burn_caps_can_blank_real (self, media, session_flags) == BRASERO_BURN_OK)
 		(*supported_flags) |= BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE;
 	else if (session_flags & BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE)

Modified: trunk/src/burn-process.c
==============================================================================
--- trunk/src/burn-process.c	(original)
+++ trunk/src/burn-process.c	Sat Jan 17 12:37:12 2009
@@ -89,6 +89,7 @@
 static GObjectClass *parent_class = NULL;
 
 /* This is a helper function for plugins at load time */
+
 gboolean
 brasero_process_check_path (const gchar *name,
 			    gchar **error)
@@ -103,49 +104,30 @@
 		return BRASERO_BURN_ERR;
 	}
 
-	/* make sure that's not a symlink pointing to something with another
-	 * name like wodim. */
-	if (g_file_test (prog_path, G_FILE_TEST_IS_SYMLINK)) {
-		GFile *file;
-		GFileInfo *info;
-		gchar *prog_name;
-		const gchar *target;
-
-		file = g_file_new_for_path (prog_path);
+	if (!g_file_test (prog_path, G_FILE_TEST_IS_EXECUTABLE)) {
 		g_free (prog_path);
+		*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
+		return BRASERO_BURN_ERR;
+	}
 
-		if (!file) {
-			*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
-			return BRASERO_BURN_ERR;
-		}
-
-		info = g_file_query_info (file,
-					  G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET,
-					  G_FILE_QUERY_INFO_NONE,
-					  NULL,
-					  NULL);
-		g_object_unref (file);
-
-		if (!info) {
-			*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
-			return BRASERO_BURN_ERR;
-		}
-
-		target = g_file_info_get_symlink_target (info);
-		prog_name = g_path_get_basename (target);
-		g_object_unref (info);
-
-		if (!prog_name || strcmp (prog_name, name)) {
-			g_free (prog_name);
-			*error = g_strdup_printf (_("\"%s\" is a symlink pointing to another program. Use the target program instead"), name);
-			return BRASERO_BURN_ERR;
-		}
-
-		g_free (prog_name);
+	/* make sure that's not a symlink pointing to something with another
+	 * name like wodim.
+	 * NOTE: we used to test the target and see if it had the same name as
+	 * the symlink with GIO. The problem is, when the symlink pointed to
+	 * another symlink, then GIO didn't follow that other symlink. And in
+	 * the end it didn't work. So forbid all symlink. */
+	if (g_file_test (prog_path, G_FILE_TEST_IS_SYMLINK)) {
+		*error = g_strdup_printf (_("\"%s\" is a symlink pointing to another program. Use the target program instead"), name);
+		return BRASERO_BURN_ERR;
 	}
-	else
+	/* Make sure it's a regular file */
+	else if (!g_file_test (prog_path, G_FILE_TEST_IS_REGULAR)) {
+		*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
 		g_free (prog_path);
+		return BRASERO_BURN_ERR;
+	}
 
+	g_free (prog_path);
 	return BRASERO_BURN_OK;
 }
 



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