[gnome-calendar] util: use new GNOME Settings app id
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] util: use new GNOME Settings app id
- Date: Thu, 7 Apr 2022 22:50:36 +0000 (UTC)
commit 1de480f102f25145bcbc3baf17c5786fed0f1ff8
Author: nahuelwexd <nahuel nahuelwexd com>
Date: Thu Apr 7 18:57:38 2022 -0300
util: use new GNOME Settings app id
src/utils/gcal-utils.c | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/src/utils/gcal-utils.c b/src/utils/gcal-utils.c
index 044a0158..2b9f26f3 100644
--- a/src/utils/gcal-utils.c
+++ b/src/utils/gcal-utils.c
@@ -1112,6 +1112,21 @@ filter_children_by_uid_and_modtype (GtkWidget *widget,
return result;
}
+static GDBusProxy *
+create_dbus_proxy (GDBusConnection *connection,
+ const gchar *name,
+ const gchar *object_path)
+{
+ return g_dbus_proxy_new_sync (connection,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ name,
+ object_path,
+ "org.gtk.Actions",
+ NULL,
+ NULL);
+}
+
void
gcal_utils_launch_online_accounts_panel (GDBusConnection *connection,
const gchar *action,
@@ -1143,14 +1158,11 @@ gcal_utils_launch_online_accounts_panel (GDBusConnection *connection,
params[1] = g_variant_new_array (G_VARIANT_TYPE ("v"), array, 1);
params[2] = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0);
- proxy = g_dbus_proxy_new_sync (connection,
- G_DBUS_PROXY_FLAGS_NONE,
- NULL,
- "org.gnome.ControlCenter",
- "/org/gnome/ControlCenter",
- "org.gtk.Actions",
- NULL,
- NULL);
+ proxy = create_dbus_proxy (connection, "org.gnome.Settings", "/org/gnome/Settings");
+
+ /* Fallback for old GNOME versions */
+ if (!proxy)
+ proxy = create_dbus_proxy (connection, "org.gnome.ControlCenter", "/org/gnome/ControlCenter");
if (!proxy)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]