brasero r1767 - trunk/src



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

Log:
Revert changes 1765 that were not supposed to take place

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:45:21 2009
@@ -248,8 +248,6 @@
 					      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;
@@ -673,11 +671,10 @@
 	}
 	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:45:21 2009
@@ -99,14 +99,6 @@
 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)				\
 {										\
@@ -2466,10 +2458,9 @@
 						  supported_flags,
 						  compulsory_flags);
 
-	/* 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)
+	/* 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))
 	&&  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:45:21 2009
@@ -89,7 +89,6 @@
 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)
@@ -104,30 +103,49 @@
 		return BRASERO_BURN_ERR;
 	}
 
-	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;
-	}
-
 	/* 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. */
+	 * name like wodim. */
 	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;
-	}
-	/* 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);
+		GFile *file;
+		GFileInfo *info;
+		gchar *prog_name;
+		const gchar *target;
+
+		file = g_file_new_for_path (prog_path);
 		g_free (prog_path);
-		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);
 	}
+	else
+		g_free (prog_path);
 
-	g_free (prog_path);
 	return BRASERO_BURN_OK;
 }
 



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