[grilo] core: add username and password keys to GrlConfig
- From: Iago Toral Quiroga <itoral src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: add username and password keys to GrlConfig
- Date: Mon, 17 Jan 2011 09:08:18 +0000 (UTC)
commit 763292631062717b3a938699e1316101f6684fdd
Author: Fabien Lebaillif - Delamare <fabien developers arq-media com>
Date: Wed Jan 12 13:40:03 2011 +0000
core: add username and password keys to GrlConfig
Signed-off-by: Iago Toral Quiroga <itoral igalia com>
src/data/grl-config.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++
src/data/grl-config.h | 10 ++++++++
2 files changed, 66 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-config.c b/src/data/grl-config.c
index 3bfbafe..07866b5 100644
--- a/src/data/grl-config.c
+++ b/src/data/grl-config.c
@@ -311,6 +311,36 @@ grl_config_set_api_secret (GrlConfig *config, const gchar *secret)
}
/**
+ * grl_config_set_username:
+ * @config: the config instance
+ * @username: the username
+ *
+ * Set the username in the configuration
+ */
+void
+grl_config_set_username (GrlConfig *config, const gchar *username)
+{
+ grl_config_set_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_USERNAME,
+ username);
+}
+
+/**
+ * grl_config_set_password:
+ * @config: the config instance
+ * @password: the password
+ *
+ * Set the password in the configuration
+ */
+void
+grl_config_set_password(GrlConfig *config, const gchar *password)
+{
+ grl_config_set_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_PASSWORD,
+ password);
+}
+
+/**
* grl_config_get_plugin:
* @config: the config instance
*
@@ -369,3 +399,29 @@ grl_config_get_api_secret (GrlConfig *config)
return grl_config_get_string (GRL_CONFIG (config),
GRL_CONFIG_KEY_APISECRET);
}
+
+/**
+ * grl_config_get_username:
+ * @config: the config instance
+ *
+ * Returns: the username
+ */
+const gchar *
+grl_config_get_username (GrlConfig *config)
+{
+ return grl_config_get_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_USERNAME);
+}
+
+/**
+ * grl_config_get_password:
+ * @config: the config instance
+ *
+ * Returns: the password
+ */
+const gchar *
+grl_config_get_password(GrlConfig *config)
+{
+ return grl_config_get_string (GRL_CONFIG (config),
+ GRL_CONFIG_KEY_PASSWORD);
+}
diff --git a/src/data/grl-config.h b/src/data/grl-config.h
index 7308904..b2a0f63 100644
--- a/src/data/grl-config.h
+++ b/src/data/grl-config.h
@@ -67,6 +67,8 @@ G_BEGIN_DECLS
#define GRL_CONFIG_KEY_APIKEY "api-key"
#define GRL_CONFIG_KEY_APITOKEN "api-token"
#define GRL_CONFIG_KEY_APISECRET "api-secret"
+#define GRL_CONFIG_KEY_USERNAME "username"
+#define GRL_CONFIG_KEY_PASSWORD "password"
typedef struct _GrlConfig GrlConfig;
typedef struct _GrlConfigPrivate GrlConfigPrivate;
@@ -106,6 +108,10 @@ void grl_config_set_api_token (GrlConfig *config, const gchar *token);
void grl_config_set_api_secret (GrlConfig *config, const gchar *secret);
+void grl_config_set_username (GrlConfig *config, const gchar *secret);
+
+void grl_config_set_password (GrlConfig *config, const gchar *secret);
+
const gchar *grl_config_get_plugin (GrlConfig *config);
const gchar *grl_config_get_api_key (GrlConfig *config);
@@ -114,6 +120,10 @@ const gchar *grl_config_get_api_token (GrlConfig *config);
const gchar *grl_config_get_api_secret (GrlConfig *config);
+const gchar *grl_config_get_username (GrlConfig *config);
+
+const gchar *grl_config_get_password (GrlConfig *config);
+
GType grl_config_get_type (void) G_GNUC_CONST;
GrlConfig *grl_config_new (const gchar *plugin, const gchar *source);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]