[geary/gnumdk/stable: 5/21] client: accounts: Use new GNOME Settings app-id




commit 99e8394d6202cc65e4f150e04ef4c6016ea7ce84
Author: Cédric Bellegarde <cedric bellegarde adishatz org>
Date:   Sat Jul 2 22:36:34 2022 +0200

    client: accounts: Use new GNOME Settings app-id
    
    Fix #1371

 org.gnome.Geary.json                      |  1 +
 src/client/accounts/accounts-manager.vala | 30 +++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/org.gnome.Geary.json b/org.gnome.Geary.json
index b65c3d49e..3fc409543 100644
--- a/org.gnome.Geary.json
+++ b/org.gnome.Geary.json
@@ -20,6 +20,7 @@
         "--talk-name=org.freedesktop.secrets",
         "--talk-name=org.gnome.Contacts",
         "--talk-name=org.gnome.ControlCenter",
+        "--talk-name=org.gnome.Settings",
         "--talk-name=org.gnome.OnlineAccounts",
         "--talk-name=org.gnome.evolution.dataserver.*",
         "--filesystem=xdg-cache/evolution/addressbook:ro",
diff --git a/src/client/accounts/accounts-manager.vala b/src/client/accounts/accounts-manager.vala
index f9c2bdffd..3a35093a1 100644
--- a/src/client/accounts/accounts-manager.vala
+++ b/src/client/accounts/accounts-manager.vala
@@ -856,15 +856,27 @@ public class Accounts.Manager : GLib.Object {
         // This method was based on the implementation from:
         // https://gitlab.gnome.org/GNOME/gnome-calendar/blob/master/src/gcal-source-dialog.c,
         // Courtesy Georges Basile Stavracas Neto <georges stavracas gmail com>
-        GLib.DBusProxy settings = yield new GLib.DBusProxy.for_bus(
-            GLib.BusType.SESSION,
-            GLib.DBusProxyFlags.NONE,
-            null,
-            "org.gnome.ControlCenter",
-            "/org/gnome/ControlCenter",
-            "org.gtk.Actions",
-            cancellable
-        );
+        try {
+            GLib.DBusProxy settings = yield new GLib.DBusProxy.for_bus(
+                GLib.BusType.SESSION,
+                GLib.DBusProxyFlags.NONE,
+                null,
+                "org.gnome.Settings",
+                "/org/gnome/Settings",
+                "org.gtk.Actions",
+                cancellable
+            );
+        } catch (GLib.Error) {
+            GLib.DBusProxy settings = yield new GLib.DBusProxy.for_bus(
+                GLib.BusType.SESSION,
+                GLib.DBusProxyFlags.NONE,
+                null,
+                "org.gnome.ControlCenter",
+                "/org/gnome/ControlCenter",
+                "org.gtk.Actions",
+                cancellable
+            );
+        }
 
         // @s "launch-panel"
         // @av [<@(sav) ("online-accounts", [<@s "add">, <@s "google">])>]


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