[gnome-software/wip/temp/ubuntu-xenial-rebased: 245/326] Use a common schema



commit 2fe3df6c669c52926d6ccad6dd93f246224465e1
Author: William Hua <william hua canonical com>
Date:   Fri Apr 15 15:07:19 2016 -0400

    Use a common schema

 src/plugins/gs-ubuntuone.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/gs-ubuntuone.c b/src/plugins/gs-ubuntuone.c
index 9552256..6d24ae6 100644
--- a/src/plugins/gs-ubuntuone.c
+++ b/src/plugins/gs-ubuntuone.c
@@ -34,6 +34,12 @@
 #define TOKEN_KEY       "token-key"
 #define TOKEN_SECRET    "token-secret"
 
+static SecretSchema schema = {
+       SCHEMA_NAME,
+       SECRET_SCHEMA_NONE,
+       { { "key", SECRET_SCHEMA_ATTRIBUTE_STRING } }
+};
+
 typedef struct
 {
        GCancellable *cancellable;
@@ -174,12 +180,6 @@ show_login_dialog (gpointer user_data)
 gboolean
 gs_ubuntuone_get_credentials (gchar **consumer_key, gchar **consumer_secret, gchar **token_key, gchar 
**token_secret)
 {
-       static SecretSchema schema = {
-               SCHEMA_NAME,
-               SECRET_SCHEMA_NONE,
-               { { "key", SECRET_SCHEMA_ATTRIBUTE_STRING } }
-       };
-
        SecretContext secret_context = { 0 };
 
        /* Use credentials from libsecret if available */
@@ -244,12 +244,6 @@ gs_ubuntuone_get_credentials (gchar **consumer_key, gchar **consumer_secret, gch
 gboolean
 gs_ubuntuone_sign_in (gchar **consumer_key, gchar **consumer_secret, gchar **token_key, gchar 
**token_secret, GError **error)
 {
-       static SecretSchema schema = {
-               SCHEMA_NAME,
-               SECRET_SCHEMA_NONE,
-               { { "key", SECRET_SCHEMA_ATTRIBUTE_STRING } }
-       };
-
        LoginContext login_context = { 0 };
 
        /* Pop up a login dialog */


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