[gnome-software/wip/temp/ubuntu-xenial-rebased-corrected: 114/331] Use libsecret for storing Ubuntu One credentials



commit d588f95735511d25b10308a453858386430b4828
Author: William Hua <william hua canonical com>
Date:   Mon Feb 22 18:06:09 2016 -0500

    Use libsecret for storing Ubuntu One credentials

 configure.ac                           |    1 +
 src/plugins/Makefile.am                |    9 ++++++++-
 src/plugins/gs-plugin-ubuntu-reviews.c |    7 +++++++
 3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 358917d..aaae0b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,7 @@ PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.51.92)
 PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.11.5)
 PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0 >= 3.17.92)
 PKG_CHECK_MODULES(OAUTH, oauth)
+PKG_CHECK_MODULES(LIBSECRET, libsecret-1)
 AC_PATH_PROG(APPSTREAM_UTIL, [appstream-util], [unfound])
 AC_ARG_ENABLE(man,
               [AS_HELP_STRING([--enable-man],
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 0dd8b19..921b372 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -14,6 +14,7 @@ AM_CPPFLAGS =                                         \
        $(LIMBA_CFLAGS)                                 \
        $(XDG_APP_CFLAGS)                               \
        $(OAUTH_CFLAGS)                                 \
+       $(LIBSECRET_CFLAGS)                             \
        -DBINDIR=\"$(bindir)\"                          \
        -DDATADIR=\"$(datadir)\"                        \
        -DGS_MODULESETDIR=\"$(datadir)/gnome-software/modulesets.d\" \
@@ -179,7 +180,13 @@ endif
 libgs_plugin_ubuntu_reviews_la_SOURCES =               \
        gs-plugin-ubuntu-reviews.c                      \
        gs-ubuntu-login-dialog.c
-libgs_plugin_ubuntu_reviews_la_LIBADD = $(GS_PLUGIN_LIBS) $(SOUP_LIBS) $(JSON_GLIB_LIBS) $(OAUTH_LIBS) 
$(SQLITE_LIBS)
+libgs_plugin_ubuntu_reviews_la_LIBADD =                        \
+       $(GS_PLUGIN_LIBS)                               \
+       $(SOUP_LIBS)                                    \
+       $(JSON_GLIB_LIBS)                               \
+       $(OAUTH_LIBS)                                   \
+       $(SQLITE_LIBS)                                  \
+       $(LIBSECRET_LIBS)
 libgs_plugin_ubuntu_reviews_la_LDFLAGS = -module -avoid-version
 libgs_plugin_ubuntu_reviews_la_CFLAGS = $(GS_PLUGIN_CFLAGS) $(WARN_CFLAGS)
 
diff --git a/src/plugins/gs-plugin-ubuntu-reviews.c b/src/plugins/gs-plugin-ubuntu-reviews.c
index aa006eb..01e51cf 100644
--- a/src/plugins/gs-plugin-ubuntu-reviews.c
+++ b/src/plugins/gs-plugin-ubuntu-reviews.c
@@ -27,12 +27,19 @@
 #include <json-glib/json-glib.h>
 #include <oauth.h>
 #include <sqlite3.h>
+#include <libsecret/secret.h>
 
 #include <gs-plugin.h>
 #include <gs-utils.h>
 
 #include "gs-os-release.h"
 
+#define SCHEMA_NAME     "com.ubuntu.UbuntuOne.GnomeSoftware"
+#define CONSUMER_KEY    "consumer-key"
+#define CONSUMER_SECRET "consumer-secret"
+#define TOKEN_KEY       "token-key"
+#define TOKEN_SECRET    "token-secret"
+
 struct GsPluginPrivate {
        gchar           *db_path;
        sqlite3         *db;


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