[seahorse] gkr: Backend: load_collections can have errors



commit 4022a0108ec3055c537283f78dbb5dcdee1f6ddf
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Jan 13 10:22:49 2019 +0100

    gkr: Backend: load_collections can have errors
    
    Make sure we also call the appropriate finish method of
    `SecretService::load_collections()`, as that at least tells us if
    something went wrong.
    
    Found out this snipped, as somehow the `Items` property showed an
    item that didn't exist as an object path. This made the loading of the
    whole collection fail, so I couldn't view the login keyring anymore in
    Seahorse, which is quite unfortunate.

 gkr/gkr-backend.vala | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gkr/gkr-backend.vala b/gkr/gkr-backend.vala
index 75445661..03d1b24b 100644
--- a/gkr/gkr-backend.vala
+++ b/gkr/gkr-backend.vala
@@ -82,12 +82,16 @@ public class Backend: GLib.Object , Gcr.Collection, Seahorse.Backend {
                                          Secret.ServiceFlags.OPEN_SESSION, null, (obj, res) => {
                        try {
                                this._service = Secret.Service.open.end(res);
-                               this._service.notify.connect((pspec) => {
-                                       if (pspec.name == "collections")
-                                               refresh_collections();
+                               this._service.notify["collections"].connect((obj, pspec) => {
+                                       refresh_collections();
                                });
                                this._service.load_collections.begin(null, (obj, res) => {
-                                       refresh_collections();
+                                       try {
+                                               this._service.load_collections.end(res);
+                                               refresh_collections();
+                                       } catch (GLib.Error e) {
+                                               warning("couldn't load all secret collections: %s", 
e.message);
+                                       }
                                });
                                refresh_aliases();
                        } catch (GLib.Error err) {


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