brasero r1455 - in trunk: . src



Author: philippr
Date: Sun Nov  2 13:32:45 2008
New Revision: 1455
URL: http://svn.gnome.org/viewvc/brasero?rev=1455&view=rev

Log:
	Some cleanups of headers and API

	* src/brasero-plugin-manager-ui.c
	(plugin_manager_ui_populate_lists):
	* src/burn-caps.c (brasero_plugin_can_burn),
	(brasero_plugin_can_image), (brasero_plugin_can_convert):
	* src/burn-caps.h:
	* src/burn-plugin-manager.c
	(brasero_plugin_manager_set_plugins_state),
	(brasero_plugin_manager_plugin_state_changed):
	* src/burn-plugin-manager.h:
	* src/burn-plugin-private.h:
	* src/burn-plugin.c (brasero_plugin_get_gconf_priority_key):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-plugin-manager-ui.c
   trunk/src/burn-caps.c
   trunk/src/burn-caps.h
   trunk/src/burn-plugin-manager.c
   trunk/src/burn-plugin-manager.h
   trunk/src/burn-plugin-private.h
   trunk/src/burn-plugin.c

Modified: trunk/src/brasero-plugin-manager-ui.c
==============================================================================
--- trunk/src/brasero-plugin-manager-ui.c	(original)
+++ trunk/src/brasero-plugin-manager-ui.c	Sun Nov  2 13:32:45 2008
@@ -355,9 +355,9 @@
 	for (; plugins; plugins = plugins->next) {
 		plugin = plugins->data;
 
-		if (brasero_burn_caps_plugin_can_burn (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_convert (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_image (caps, plugin) == BRASERO_BURN_OK
+		if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_image (plugin) == BRASERO_BURN_OK
 		||  brasero_plugin_get_gtype (plugin) == G_TYPE_NONE)
 			continue;
 

Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c	(original)
+++ trunk/src/burn-caps.c	Sun Nov  2 13:32:45 2008
@@ -3662,10 +3662,12 @@
  */
 
 BraseroBurnResult
-brasero_burn_caps_plugin_can_burn (BraseroBurnCaps *self,
-				   BraseroPlugin *plugin)
+brasero_plugin_can_burn (BraseroPlugin *plugin)
 {
 	GSList *iter;
+	BraseroBurnCaps *self;
+
+	self = brasero_burn_caps_get_default ();
 
 	for (iter = self->priv->caps_list; iter; iter = iter->next) {
 		BraseroCaps *caps;
@@ -3696,11 +3698,12 @@
 }
 
 BraseroBurnResult
-brasero_burn_caps_plugin_can_image (BraseroBurnCaps *self,
-				    BraseroPlugin *plugin)
+brasero_plugin_can_image (BraseroPlugin *plugin)
 {
 	GSList *iter;
+	BraseroBurnCaps *self;
 
+	self = brasero_burn_caps_get_default ();
 	for (iter = self->priv->caps_list; iter; iter = iter->next) {
 		BraseroTrackDataType destination;
 		BraseroCaps *caps;
@@ -3737,11 +3740,12 @@
 }
 
 BraseroBurnResult
-brasero_burn_caps_plugin_can_convert (BraseroBurnCaps *self,
-				      BraseroPlugin *plugin)
+brasero_plugin_can_convert (BraseroPlugin *plugin)
 {
 	GSList *iter;
+	BraseroBurnCaps *self;
 
+	self = brasero_burn_caps_get_default ();
 	for (iter = self->priv->caps_list; iter; iter = iter->next) {
 		BraseroTrackDataType destination;
 		BraseroCaps *caps;

Modified: trunk/src/burn-caps.h
==============================================================================
--- trunk/src/burn-caps.h	(original)
+++ trunk/src/burn-caps.h	Sun Nov  2 13:32:45 2008
@@ -139,14 +139,4 @@
 				      BraseroBurnFlag *supported,
 				      BraseroBurnFlag *compulsory);
 
-BraseroBurnResult
-brasero_burn_caps_plugin_can_burn (BraseroBurnCaps *caps,
-				   BraseroPlugin *plugin);
-BraseroBurnResult
-brasero_burn_caps_plugin_can_image (BraseroBurnCaps *caps,
-				    BraseroPlugin *plugin);
-BraseroBurnResult
-brasero_burn_caps_plugin_can_convert (BraseroBurnCaps *caps,
-				      BraseroPlugin *plugin);
-
 #endif /* BURN_CAPS_H */

Modified: trunk/src/burn-plugin-manager.c
==============================================================================
--- trunk/src/burn-plugin-manager.c	(original)
+++ trunk/src/burn-plugin-manager.c	Sun Nov  2 13:32:45 2008
@@ -34,7 +34,6 @@
 
 #include "burn-basics.h"
 #include "burn-debug.h"
-#include "burn-caps.h"
 #include "burn-track.h"
 #include "burn-plugin.h"
 #include "burn-plugin-private.h"
@@ -130,7 +129,6 @@
 	GConfClient *client;
 	GSList *names = NULL;
 	GError *error = NULL;
-	BraseroBurnCaps *caps;
 	BraseroPluginManagerPrivate *priv;
 
 	priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
@@ -138,7 +136,6 @@
 	/* get the list of user requested plugins. while at it we add a watch
 	 * on the key so as to be warned whenever the user changes prefs. */
 	client = gconf_client_get_default ();
-	caps = brasero_burn_caps_get_default ();
 
 	if (priv->notification) {
 		gconf_client_notify_remove (client, priv->notification);
@@ -169,9 +166,9 @@
 
 			plugin = iter->data;
 
-			if (brasero_burn_caps_plugin_can_burn (caps, plugin) == BRASERO_BURN_OK
-			||  brasero_burn_caps_plugin_can_convert (caps, plugin) == BRASERO_BURN_OK
-			||  brasero_burn_caps_plugin_can_image (caps, plugin) == BRASERO_BURN_OK) {
+			if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
+			||  brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
+			||  brasero_plugin_can_image (plugin) == BRASERO_BURN_OK) {
 				brasero_plugin_set_active (plugin, TRUE);
 				continue;
 			}
@@ -188,9 +185,9 @@
 
 		plugin = iter->data;
 
-		if (brasero_burn_caps_plugin_can_burn (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_convert (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_image (caps, plugin) == BRASERO_BURN_OK) {
+		if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_image (plugin) == BRASERO_BURN_OK) {
 			brasero_plugin_set_active (plugin, TRUE);
 			BRASERO_BURN_LOG ("Setting plugin %s %s",
 					  brasero_plugin_get_name (plugin),
@@ -234,8 +231,6 @@
 
 end:
 
-	g_object_unref (caps);
-
 	BRASERO_BURN_LOG ("Watching GConf plugin key");
 	priv->notification = gconf_client_notify_add (client,
 						      BRASERO_PLUGIN_KEY,
@@ -253,7 +248,6 @@
 					     BraseroPluginManager *self)
 {
 	BraseroPluginManagerPrivate *priv;
-	BraseroBurnCaps *caps;
 	GError *error = NULL;
 	GConfClient *client;
 	GSList *list = NULL;
@@ -263,7 +257,6 @@
 	priv = BRASERO_PLUGIN_MANAGER_PRIVATE (self);
 
 	/* build a list of all active plugins */
-	caps = brasero_burn_caps_get_default ();
 	for (iter = priv->plugins; iter; iter = iter->next) {
 		BraseroPlugin *plugin;
 		const gchar *name;
@@ -272,16 +265,15 @@
 		if (!brasero_plugin_get_active (plugin))
 			continue;
 
-		if (brasero_burn_caps_plugin_can_burn (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_convert (caps, plugin) == BRASERO_BURN_OK
-		||  brasero_burn_caps_plugin_can_image (caps, plugin) == BRASERO_BURN_OK)
+		if (brasero_plugin_can_burn (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_convert (plugin) == BRASERO_BURN_OK
+		||  brasero_plugin_can_image (plugin) == BRASERO_BURN_OK)
 			continue;
 
 		name = brasero_plugin_get_name (plugin);
 		if (name)
 			list = g_slist_prepend (list, (gchar *) name);
 	}
-	g_object_unref (caps);
 
 	client = gconf_client_get_default ();
 	if (priv->notification) {

Modified: trunk/src/burn-plugin-manager.h
==============================================================================
--- trunk/src/burn-plugin-manager.h	(original)
+++ trunk/src/burn-plugin-manager.h	Sun Nov  2 13:32:45 2008
@@ -26,10 +26,6 @@
 #include <glib-object.h>
 #include <gmodule.h>
 
-#include "burn-basics.h"
-#include "burn-plugin.h"
-#include "burn-task.h"
-
 G_BEGIN_DECLS
 
 #define BRASERO_TYPE_PLUGIN_MANAGER             (brasero_plugin_manager_get_type ())

Modified: trunk/src/burn-plugin-private.h
==============================================================================
--- trunk/src/burn-plugin-private.h	(original)
+++ trunk/src/burn-plugin-private.h	Sun Nov  2 13:32:45 2008
@@ -118,6 +118,21 @@
 brasero_plugin_get_process_flags (BraseroPlugin *plugin,
 				  BraseroPluginProcessFlag *flags);
 
+
+/** 
+ * This is to find out what are the capacities of a plugin 
+ */
+
+BraseroBurnResult
+brasero_plugin_can_burn (BraseroPlugin *plugin);
+
+BraseroBurnResult
+brasero_plugin_can_image (BraseroPlugin *plugin);
+
+BraseroBurnResult
+brasero_plugin_can_convert (BraseroPlugin *plugin);
+
+
 /**
  * Plugin configuration options
  */

Modified: trunk/src/burn-plugin.c
==============================================================================
--- trunk/src/burn-plugin.c	(original)
+++ trunk/src/burn-plugin.c	Sun Nov  2 13:32:45 2008
@@ -388,11 +388,11 @@
 	caps = brasero_burn_caps_get_default ();
 
 	/* make sure the name used has characters usable by GConf */
-	if (brasero_burn_caps_plugin_can_burn (caps, self) == BRASERO_BURN_OK)
+	if (brasero_plugin_can_burn (self) == BRASERO_BURN_OK)
 		type = 0;
-	else if (brasero_burn_caps_plugin_can_image (caps, self) == BRASERO_BURN_OK)
+	else if (brasero_plugin_can_image (self) == BRASERO_BURN_OK)
 		type = 1;
-	else if (brasero_burn_caps_plugin_can_convert (caps, self) == BRASERO_BURN_OK)
+	else if (brasero_plugin_can_convert (self) == BRASERO_BURN_OK)
 		type = 2;
 
 	gconf_name = g_strdup (priv->name);



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