[geary/wip/784300-unlock-keyring: 1/2] Remove custom libsecret VAPI in favour of the system-provided one.



commit 7aaf650de91fab1a0d4b12b10eeb8a82f9e402c7
Author: Michael James Gratton <mike vee net>
Date:   Thu Oct 26 22:03:24 2017 +1100

    Remove custom libsecret VAPI in favour of the system-provided one.
    
    This gives us access to the full libsecret API.
    
    * bindings/vapi/libsecret-1.vapi: Deleted.
    
    * src/client/application/secret-mediator.vala (Object): Use an internal
      binding to the missing SCHEMA_COMPAT_NETWORK constant.

 bindings/vapi/libsecret-1.vapi              |   82 ---------------------------
 src/client/application/secret-mediator.vala |   14 +++--
 2 files changed, 9 insertions(+), 87 deletions(-)
---
diff --git a/src/client/application/secret-mediator.vala b/src/client/application/secret-mediator.vala
index f9bbc34..4b37325 100644
--- a/src/client/application/secret-mediator.vala
+++ b/src/client/application/secret-mediator.vala
@@ -23,6 +23,10 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
     private GearyApplication instance;
     private Geary.Nonblocking.Mutex dialog_mutex = new Geary.Nonblocking.Mutex();
 
+    // See Bug 697681
+    [CCode (cheader_filename = "libsecret/secret.h", cname = "SECRET_SCHEMA_COMPAT_NETWORK")]
+    private Secret.Schema SCHEMA_COMPAT_NETWORK;
+
 
     public SecretMediator(GearyApplication instance) {
         this.instance = instance;
@@ -71,13 +75,13 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
         // Remove legacy formats
         // <= 0.11
         yield Secret.password_clear(
-            Secret.SCHEMA_COMPAT_NETWORK,
+            SCHEMA_COMPAT_NETWORK,
             cancellable,
             "user", get_legacy_user(service, account.primary_mailbox.address)
         );
         // <= 0.6
         yield Secret.password_clear(
-            Secret.SCHEMA_COMPAT_NETWORK,
+            SCHEMA_COMPAT_NETWORK,
             cancellable,
             "user", get_legacy_user(service, credentials.user)
          );
@@ -195,7 +199,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
     throws Error {
         // <= 0.11
         string? password = yield Secret.password_lookup(
-            Secret.SCHEMA_COMPAT_NETWORK,
+            SCHEMA_COMPAT_NETWORK,
             cancellable,
             "user", get_legacy_user(service, account.primary_mailbox.address)
         );
@@ -205,7 +209,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
             Geary.Credentials creds = get_credentials(service, account);
             string user = get_legacy_user(service, creds.user);
             password = yield Secret.password_lookup(
-                Secret.SCHEMA_COMPAT_NETWORK,
+                SCHEMA_COMPAT_NETWORK,
                 cancellable,
                 "user", user
             );
@@ -213,7 +217,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
             // Clear the old password
             if (password != null) {
                 yield Secret.password_clear(
-                    Secret.SCHEMA_COMPAT_NETWORK,
+                    SCHEMA_COMPAT_NETWORK,
                     cancellable,
                     "user", user
                 );


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