diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-03-27 18:04:28 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-04-06 22:23:39 -0300 |
commit | 754434fa0dab020046ff4a198ba259c3b6d6d7d5 (patch) | |
tree | 24e10c40d041553c2a8e755d75157d9f901ef918 | |
parent | 28ad1d1602d50bccd915cd44b114ca4ef6bba6c0 (diff) | |
download | gnome-control-center-754434fa0dab020046ff4a198ba259c3b6d6d7d5.tar.gz |
privacy: Cache D-Bus proxies
-rw-r--r-- | panels/privacy/cc-privacy-panel.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/panels/privacy/cc-privacy-panel.c b/panels/privacy/cc-privacy-panel.c index 428dafef7..daa050a41 100644 --- a/panels/privacy/cc-privacy-panel.c +++ b/panels/privacy/cc-privacy-panel.c @@ -18,6 +18,7 @@ * Author: Matthias Clasen <mclasen@redhat.com> */ +#include "shell/cc-object-storage.h" #include "shell/list-box-helper.h" #include "cc-privacy-panel.h" #include "cc-privacy-resources.h" @@ -463,7 +464,7 @@ on_gclue_manager_ready (GObject *source_object, GDBusProxy *proxy; GError *error = NULL; - proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + proxy = cc_object_storage_create_dbus_proxy_finish (res, &error); if (proxy == NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -475,10 +476,11 @@ on_gclue_manager_ready (GObject *source_object, self = user_data; self->priv->gclue_manager = proxy; - g_signal_connect (self->priv->gclue_manager, - "g-properties-changed", - G_CALLBACK (on_gclue_manager_props_changed), - self); + g_signal_connect_object (self->priv->gclue_manager, + "g-properties-changed", + G_CALLBACK (on_gclue_manager_props_changed), + self, + 0); update_location_label (self); } @@ -783,7 +785,7 @@ on_perm_store_ready (GObject *source_object, GVariant *params; GError *error = NULL; - proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + proxy = cc_object_storage_create_dbus_proxy_finish (res, &error); if (proxy == NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -842,25 +844,23 @@ add_location (CcPrivacyPanel *self) g_free, g_object_unref); - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - "org.freedesktop.GeoClue2", - "/org/freedesktop/GeoClue2/Manager", - "org.freedesktop.GeoClue2.Manager", - priv->cancellable, - on_gclue_manager_ready, - self); - - g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - "org.freedesktop.impl.portal.PermissionStore", - "/org/freedesktop/impl/portal/PermissionStore", - "org.freedesktop.impl.portal.PermissionStore", - priv->cancellable, - on_perm_store_ready, - self); + cc_object_storage_create_dbus_proxy (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_NONE, + "org.freedesktop.GeoClue2", + "/org/freedesktop/GeoClue2/Manager", + "org.freedesktop.GeoClue2.Manager", + priv->cancellable, + on_gclue_manager_ready, + self); + + cc_object_storage_create_dbus_proxy (G_BUS_TYPE_SESSION, + G_DBUS_PROXY_FLAGS_NONE, + "org.freedesktop.impl.portal.PermissionStore", + "/org/freedesktop/impl/portal/PermissionStore", + "org.freedesktop.impl.portal.PermissionStore", + priv->cancellable, + on_perm_store_ready, + self); } static void |