brasero r1454 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1454 - in trunk: . src
- Date: Sat, 1 Nov 2008 15:28:06 +0000 (UTC)
Author: philippr
Date: Sat Nov 1 15:28:06 2008
New Revision: 1454
URL: http://svn.gnome.org/viewvc/brasero?rev=1454&view=rev
Log:
Small code cleanup
* src/burn-caps.c (brasero_plugin_register_group):
* src/burn-caps.h:
* src/burn-plugin.c (brasero_plugin_set_group):
Modified:
trunk/ChangeLog
trunk/src/burn-caps.c
trunk/src/burn-caps.h
trunk/src/burn-plugin.c
Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c (original)
+++ trunk/src/burn-caps.c Sat Nov 1 15:28:06 2008
@@ -179,38 +179,6 @@
return default_caps;
}
-gint
-brasero_burn_caps_register_plugin_group (BraseroBurnCaps *self,
- const gchar *name)
-{
- guint retval;
-
- if (!name)
- return 0;
-
- if (!self->priv->groups)
- self->priv->groups = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- NULL);
-
- retval = GPOINTER_TO_INT (g_hash_table_lookup (self->priv->groups, name));
- if (retval)
- return retval;
-
- g_hash_table_insert (self->priv->groups,
- g_strdup (name),
- GINT_TO_POINTER (g_hash_table_size (self->priv->groups) + 1));
-
- /* see if we have a group id now */
- if (!self->priv->group_id
- && self->priv->group_str
- && !strcmp (name, self->priv->group_str))
- self->priv->group_id = g_hash_table_size (self->priv->groups) + 1;
-
- return g_hash_table_size (self->priv->groups) + 1;
-}
-
/* that function receives all errors returned by the object and 'learns' from
* these errors what are the safest defaults for a particular system. It should
* also offer fallbacks if an error occurs through a signal */
@@ -3642,6 +3610,53 @@
}
}
+/**
+ * This is to register a plugin group
+ * This function is only define here (though it's implemented in burn-plugin.c).
+ */
+
+void
+brasero_plugin_set_group (BraseroPlugin *plugin, gint group_id);
+
+void
+brasero_plugin_register_group (BraseroPlugin *plugin,
+ const gchar *name)
+{
+ guint retval;
+ BraseroBurnCaps *self;
+
+ if (!name) {
+ brasero_plugin_set_group (plugin, 0);
+ return;
+ }
+
+ self = brasero_burn_caps_get_default ();
+
+ if (!self->priv->groups)
+ self->priv->groups = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free,
+ NULL);
+
+ retval = GPOINTER_TO_INT (g_hash_table_lookup (self->priv->groups, name));
+ if (retval) {
+ brasero_plugin_set_group (plugin, retval);
+ return;
+ }
+
+ g_hash_table_insert (self->priv->groups,
+ g_strdup (name),
+ GINT_TO_POINTER (g_hash_table_size (self->priv->groups) + 1));
+
+ /* see if we have a group id now */
+ if (!self->priv->group_id
+ && self->priv->group_str
+ && !strcmp (name, self->priv->group_str))
+ self->priv->group_id = g_hash_table_size (self->priv->groups) + 1;
+
+ brasero_plugin_set_group (plugin, g_hash_table_size (self->priv->groups) + 1);
+}
+
/**
* This is to find out what are the capacities of a plugin
*/
Modified: trunk/src/burn-caps.h
==============================================================================
--- trunk/src/burn-caps.h (original)
+++ trunk/src/burn-caps.h Sat Nov 1 15:28:06 2008
@@ -61,10 +61,6 @@
BraseroBurnCaps *brasero_burn_caps_get_default ();
-gint
-brasero_burn_caps_register_plugin_group (BraseroBurnCaps *caps,
- const gchar *name);
-
/**
*
*/
Modified: trunk/src/burn-plugin.c
==============================================================================
--- trunk/src/burn-plugin.c (original)
+++ trunk/src/burn-plugin.c Sat Nov 1 15:28:06 2008
@@ -428,19 +428,13 @@
}
void
-brasero_plugin_register_group (BraseroPlugin *self,
- const gchar *name)
+brasero_plugin_set_group (BraseroPlugin *self,
+ gint group_id)
{
- guint id;
- BraseroBurnCaps *caps;
BraseroPluginPrivate *priv;
priv = BRASERO_PLUGIN_PRIVATE (self);
-
- caps = brasero_burn_caps_get_default ();
- id = brasero_burn_caps_register_plugin_group (caps, name);
- priv->group = id;
- g_object_unref (caps);
+ priv->group = group_id;
}
guint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]