[epiphany/secret-migration: 4/6] ephy-profile-migrator: migrate to libsecret



commit 0a211760a5073316f7716a91e1c34d541cbd22fc
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Feb 19 13:31:24 2013 +0200

    ephy-profile-migrator: migrate to libsecret
    
    Use libsecret to store http-authentication data in one
    of the early migrators.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679918

 configure.ac                |    2 --
 lib/ephy-profile-migrator.c |   23 +++++++++++------------
 2 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f478391..e13f2c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,7 +86,6 @@ LIBXSLT_REQUIRED=1.1.7
 WEBKIT_GTK_REQUIRED=1.11.5
 LIBSOUP_REQUIRED=2.41.3
 GNOME_DESKTOP_REQUIRED=2.91.2
-GNOME_KEYRING_REQUIRED=2.26.0
 LIBSECRET_REQUIRED=0.6
 GSETTINGS_DESKTOP_SCHEMAS_REQUIRED=0.0.1
 LIBNOTIFY_REQUIRED=0.5.1
@@ -130,7 +129,6 @@ PKG_CHECK_MODULES([DEPENDENCIES], [
                  libsoup-2.4 >= $LIBSOUP_REQUIRED
                  libsecret-1 >= $LIBSECRET_REQUIRED
                  gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED
-                 gnome-keyring-1 >= $GNOME_KEYRING_REQUIRED
                  gsettings-desktop-schemas >= $GSETTINGS_DESKTOP_SCHEMAS_REQUIRED
                  libnotify >= $LIBNOTIFY_REQUIRED
                  sqlite3
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index 43f36a7..7c0ea82 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -46,7 +46,7 @@
 #include <fcntl.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
-#include <gnome-keyring.h>
+#include <libsecret/secret.h>
 #include <libsoup/soup.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -252,7 +252,6 @@ parse_and_decrypt_signons (const char *signons,
       char *password = NULL;
       char *form_username = NULL;
       char *form_password = NULL;
-      guint32 item_id;
 
       /* The username */
       if (handle_forms) {
@@ -308,16 +307,16 @@ parse_and_decrypt_signons (const char *signons,
                  username && password &&
                  !g_str_equal (username, "") &&
                  form_username == NULL && form_password == NULL) {
-        gnome_keyring_set_network_password_sync (NULL,
-                                                 username,
-                                                 realm,
-                                                 uri->host,
-                                                 NULL,
-                                                 uri->scheme,
-                                                 NULL,
-                                                 uri->port,
-                                                 password,
-                                                 &item_id);
+        char *u = soup_uri_to_string (uri, FALSE);
+        secret_password_store_sync (SECRET_SCHEMA_COMPAT_NETWORK,
+                                    SECRET_COLLECTION_DEFAULT,
+                                    u, password, NULL, NULL,
+                                    "user", username,
+                                    "domain", realm,
+                                    "server", uri->host,
+                                    "protocol", uri->scheme,
+                                    "port", (gint)uri->port,
+                                    NULL);
       }
 
       g_free (username);


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