Commit a37b4bf2 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

session-item: add _get_property API

parent 05aba22c
......@@ -80,7 +80,7 @@ wp_session_item_dispose (GObject * object)
}
static void
wp_session_item_get_property (GObject * object, guint property_id,
wp_session_item_get_gobject_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec)
{
WpSessionItem *self = WP_SESSION_ITEM (object);
......@@ -193,7 +193,7 @@ wp_session_item_class_init (WpSessionItemClass * klass)
GObjectClass * object_class = (GObjectClass *) klass;
object_class->dispose = wp_session_item_dispose;
object_class->get_property = wp_session_item_get_property;
object_class->get_property = wp_session_item_get_gobject_property;
wpobject_class->get_supported_features =
session_item_default_get_supported_features;
......@@ -381,6 +381,24 @@ wp_session_item_get_properties (WpSessionItem * self)
return priv->properties ? wp_properties_ref (priv->properties) : NULL;
}
/**
* wp_session_item_get_property:
* @self: the session item
* @key: the property key
*
* Returns: the item property value for the given key.
*/
const gchar *
wp_session_item_get_property (WpSessionItem * self, const gchar *key)
{
WpSessionItemPrivate *priv = NULL;
g_return_val_if_fail (WP_IS_SESSION_ITEM (self), NULL);
priv = wp_session_item_get_instance_private (self);
return priv->properties ? wp_properties_get (priv->properties, key) : NULL;
}
/**
* wp_session_item_set_properties:
* @self: the session item
......
......@@ -100,6 +100,10 @@ void wp_session_item_remove (WpSessionItem * self);
WP_API
WpProperties * wp_session_item_get_properties (WpSessionItem * self);
WP_API
const gchar * wp_session_item_get_property (WpSessionItem * self,
const gchar *key);
/* for subclasses only */
WP_API
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment