plugin-base: use MM_TYPE_POINTER_ARRAY for custom init callbacks

This commit is contained in:
Aleksander Morgado
2012-01-13 17:32:33 +01:00
parent 0358c787c0
commit d76f545322

View File

@@ -69,7 +69,7 @@ typedef struct {
gchar **udev_tags; gchar **udev_tags;
gboolean at; gboolean at;
gboolean qcdm; gboolean qcdm;
const MMPortProbeAtCommand *custom_init; MMPortProbeAtCommand *custom_init;
guint64 send_delay; guint64 send_delay;
} MMPluginBasePrivate; } MMPluginBasePrivate;
@@ -809,7 +809,7 @@ set_property (GObject *object, guint prop_id,
break; break;
case PROP_CUSTOM_INIT: case PROP_CUSTOM_INIT:
/* Construct only */ /* Construct only */
priv->custom_init = (const MMPortProbeAtCommand *)g_value_get_pointer (value); priv->custom_init = g_value_dup_boxed (value);
break; break;
case PROP_SEND_DELAY: case PROP_SEND_DELAY:
/* Construct only */ /* Construct only */
@@ -863,7 +863,7 @@ get_property (GObject *object, guint prop_id,
g_value_set_boxed (value, priv->udev_tags); g_value_set_boxed (value, priv->udev_tags);
break; break;
case PROP_CUSTOM_INIT: case PROP_CUSTOM_INIT:
g_value_set_pointer (value, (gpointer)priv->custom_init); g_value_set_boxed (value, priv->custom_init);
break; break;
case PROP_SEND_DELAY: case PROP_SEND_DELAY:
g_value_set_uint64 (value, priv->send_delay); g_value_set_uint64 (value, priv->send_delay);
@@ -993,12 +993,13 @@ mm_plugin_base_class_init (MMPluginBaseClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_CUSTOM_INIT, (object_class, PROP_CUSTOM_INIT,
g_param_spec_pointer (MM_PLUGIN_BASE_CUSTOM_INIT, g_param_spec_boxed (MM_PLUGIN_BASE_CUSTOM_INIT,
"Custom initialization", "Custom initialization",
"List of custom initializations this plugin needs, " "List of custom initializations this plugin needs, "
"should be an array of MMPortProbeAtCommand structs " "should be an array of MMPortProbeAtCommand structs "
"finished with 'NULL'", "finished with 'NULL'",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); MM_TYPE_POINTER_ARRAY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SEND_DELAY, (object_class, PROP_SEND_DELAY,