Re: [PATCH] core: add username and passward keys to GrlConfig



Hi,

Is there anybody looking at my patches ?

[PATCH] core: add thumbnail-binary metadata key
[PATCH] core: add username and passward keys to GrlConfig
[PATCH] core: add binary api key to GrlConfig


Are they acceptable ? Is there anything to change ?

Fabien


On 1/12/2011 1:48 PM, Fabien Lebaillif - Delamare wrote:
---
  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 8bc780d..fbf7a1b 100644
--- a/src/data/grl-config.c
+++ b/src/data/grl-config.c
@@ -279,6 +279,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
   *
@@ -329,3 +359,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 f164ff8..178918b 100644
--- a/src/data/grl-config.h
+++ b/src/data/grl-config.h
@@ -65,6 +65,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;
@@ -99,6 +101,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);
@@ -107,6 +113,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);



--
 Fabien Lebaillif - Delamare



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]