info: Cache D-Bus proxies
This commit is contained in:
parent
35f948f5fb
commit
e46d505182
1 changed files with 20 additions and 22 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include "shell/cc-hostname-entry.h"
|
#include "shell/cc-hostname-entry.h"
|
||||||
|
#include "shell/cc-object-storage.h"
|
||||||
|
|
||||||
#include "cc-info-resources.h"
|
#include "cc-info-resources.h"
|
||||||
#include "info-cleanup.h"
|
#include "info-cleanup.h"
|
||||||
|
@ -235,13 +236,12 @@ get_renderer_from_session (void)
|
||||||
char *renderer;
|
char *renderer;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
session_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
session_proxy = cc_object_storage_create_dbus_proxy_sync (G_BUS_TYPE_SESSION,
|
||||||
G_DBUS_PROXY_FLAGS_NONE,
|
G_DBUS_PROXY_FLAGS_NONE,
|
||||||
NULL,
|
"org.gnome.SessionManager",
|
||||||
"org.gnome.SessionManager",
|
"/org/gnome/SessionManager",
|
||||||
"/org/gnome/SessionManager",
|
"org.gnome.SessionManager",
|
||||||
"org.gnome.SessionManager",
|
NULL, &error);
|
||||||
NULL, &error);
|
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
{
|
{
|
||||||
g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
|
g_warning ("Unable to connect to create a proxy for org.gnome.SessionManager: %s",
|
||||||
|
@ -302,13 +302,12 @@ has_dual_gpu (void)
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
g_autoptr(GError) error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
|
|
||||||
switcheroo_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
switcheroo_proxy = cc_object_storage_create_dbus_proxy_sync (G_BUS_TYPE_SYSTEM,
|
||||||
G_DBUS_PROXY_FLAGS_NONE,
|
G_DBUS_PROXY_FLAGS_NONE,
|
||||||
NULL,
|
"net.hadess.SwitcherooControl",
|
||||||
"net.hadess.SwitcherooControl",
|
"/net/hadess/SwitcherooControl",
|
||||||
"/net/hadess/SwitcherooControl",
|
"net.hadess.SwitcherooControl",
|
||||||
"net.hadess.SwitcherooControl",
|
NULL, &error);
|
||||||
NULL, &error);
|
|
||||||
if (switcheroo_proxy == NULL)
|
if (switcheroo_proxy == NULL)
|
||||||
{
|
{
|
||||||
g_debug ("Unable to connect to create a proxy for net.hadess.SwitcherooControl: %s",
|
g_debug ("Unable to connect to create a proxy for net.hadess.SwitcherooControl: %s",
|
||||||
|
@ -720,14 +719,13 @@ info_overview_panel_setup_virt (CcInfoOverviewPanel *self)
|
||||||
g_autoptr(GVariant) variant = NULL;
|
g_autoptr(GVariant) variant = NULL;
|
||||||
GVariant *inner;
|
GVariant *inner;
|
||||||
|
|
||||||
systemd_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
|
systemd_proxy = cc_object_storage_create_dbus_proxy_sync (G_BUS_TYPE_SYSTEM,
|
||||||
G_DBUS_PROXY_FLAGS_NONE,
|
G_DBUS_PROXY_FLAGS_NONE,
|
||||||
NULL,
|
"org.freedesktop.systemd1",
|
||||||
"org.freedesktop.systemd1",
|
"/org/freedesktop/systemd1",
|
||||||
"/org/freedesktop/systemd1",
|
"org.freedesktop.systemd1",
|
||||||
"org.freedesktop.systemd1",
|
NULL,
|
||||||
NULL,
|
&error);
|
||||||
&error);
|
|
||||||
|
|
||||||
if (systemd_proxy == NULL)
|
if (systemd_proxy == NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue