summaryrefslogtreecommitdiffstats
path: root/lasso/id-ff/profile.c
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-27 08:19:30 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-04-27 08:19:30 +0000
commit962a5d24036546e820f54d94deab39fd4fcaaaa0 (patch)
tree663ff518cc4956cf6ee204fea2c2d4abd9d712b4 /lasso/id-ff/profile.c
parentecb84ebd1d22c2cf4fe870633b1a242632cb7df3 (diff)
downloadlasso-962a5d24036546e820f54d94deab39fd4fcaaaa0.tar.gz
lasso-962a5d24036546e820f54d94deab39fd4fcaaaa0.tar.xz
lasso-962a5d24036546e820f54d94deab39fd4fcaaaa0.zip
new function lasso_profile_get_server()
* lasso/id-ff/profile.c: * lasso/id-ff/profile.h: in a move to try to remove direct access to object content, add a function to retrieve the LassoServer object of a LassoProfile. * bindings/overrides.xml: it conflicts with direct access to the public field server, so we do not export it in the binding for now.
Diffstat (limited to 'lasso/id-ff/profile.c')
-rw-r--r--lasso/id-ff/profile.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c
index 650c29f7..b616228c 100644
--- a/lasso/id-ff/profile.c
+++ b/lasso/id-ff/profile.c
@@ -417,6 +417,32 @@ lasso_profile_set_artifact_message(LassoProfile *profile, char *message)
profile->private_data->artifact_message = g_strdup(message);
}
+/**
+ * lasso_profile_get_server:
+ * @profile: a #LassoProfile object
+ *
+ * Return the #LassoServer linked to this profile object. A profile object should always contains
+ * one. It allows to find metadatas of other providers and to know our own metadatas.
+ *
+ * Return value: a #LassoServer or NULL if profile is not a #LassoProfile or no #LassoServer object
+ * was setup at the creation of this profile.
+ */
+LassoServer*
+lasso_profile_get_server(LassoProfile *profile)
+{
+ g_return_val_if_fail(LASSO_IS_PROFILE(profile), NULL);
+
+ if (profile->server) {
+ if (LASSO_IS_SERVER(profile->server)) {
+ return profile->server;
+ } else {
+ message(G_LOG_LEVEL_WARNING, "profile->server contains a non LassoServer object");
+ }
+ }
+
+ return NULL;
+}
+
/*****************************************************************************/
/* private methods */