udisks_client_new
udisks_client_new_finish
udisks_client_new_sync
-udisks_client_get_proxy_manager
+udisks_client_get_object_manager
<SUBSECTION Standard>
UDISKS_TYPE_CLIENT
UDISKS_CLIENT
{
GObject parent_instance;
GDBusConnection *connection;
- GDBusObjectManager *object_manager;
+ GDBusObjectManagerServer *object_manager;
UDisksMountMonitor *mount_monitor;
g_error_free (error);
}
- daemon->object_manager = g_dbus_object_manager_new (daemon->connection, "/org/freedesktop/UDisks2");
+ daemon->object_manager = g_dbus_object_manager_server_new (daemon->connection, "/org/freedesktop/UDisks2");
if (!g_file_test (TMP_STATEDIR, G_FILE_TEST_IS_DIR))
{
PROP_OBJECT_MANAGER,
g_param_spec_object ("object-manager",
"Object Manager",
- "The D-Bus Object Manager used by the daemon",
- G_TYPE_DBUS_OBJECT_MANAGER,
+ "The D-Bus Object Manager server used by the daemon",
+ G_TYPE_DBUS_OBJECT_MANAGER_SERVER,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
*
* Gets the D-Bus object manager used by @daemon.
*
- * Returns: A #GDBusObjectManager. Do not free, the object is owned by @daemon.
+ * Returns: A #GDBusObjectManagerServer. Do not free, the object is owned by @daemon.
*/
-GDBusObjectManager *
+GDBusObjectManagerServer *
udisks_daemon_get_object_manager (UDisksDaemon *daemon)
{
g_return_val_if_fail (UDISKS_IS_DAEMON (daemon), NULL);
g_assert (object != NULL);
/* Unexport job */
- g_dbus_object_manager_unexport (daemon->object_manager,
- g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
+ g_dbus_object_manager_server_unexport (daemon->object_manager,
+ g_dbus_object_get_object_path (G_DBUS_OBJECT (object)));
g_dbus_object_stub_remove_interface (object, G_DBUS_INTERFACE_STUB (job));
g_object_unref (object);
g_dbus_object_stub_add_interface (object, G_DBUS_INTERFACE_STUB (job));
g_free (object_path);
- g_dbus_object_manager_export (daemon->object_manager, object);
+ g_dbus_object_manager_server_export (daemon->object_manager, object);
g_signal_connect_after (job,
"completed",
G_CALLBACK (on_job_completed),
g_dbus_object_stub_add_interface (object, G_DBUS_INTERFACE_STUB (job));
g_free (object_path);
- g_dbus_object_manager_export (daemon->object_manager, object);
+ g_dbus_object_manager_server_export (daemon->object_manager, object);
g_signal_connect_after (job,
"completed",
G_CALLBACK (on_job_completed),
g_dbus_object_stub_add_interface (object, G_DBUS_INTERFACE_STUB (job));
g_free (object_path);
- g_dbus_object_manager_export (daemon->object_manager, object);
+ g_dbus_object_manager_server_export (daemon->object_manager, object);
g_signal_connect_after (job,
"completed",
G_CALLBACK (on_job_completed),
#define UDISKS_DAEMON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UDISKS_TYPE_DAEMON, UDisksDaemon))
#define UDISKS_IS_DAEMON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_DAEMON))
-GType udisks_daemon_get_type (void) G_GNUC_CONST;
-UDisksDaemon *udisks_daemon_new (GDBusConnection *connection);
-GDBusConnection *udisks_daemon_get_connection (UDisksDaemon *daemon);
-GDBusObjectManager *udisks_daemon_get_object_manager (UDisksDaemon *daemon);
-UDisksMountMonitor *udisks_daemon_get_mount_monitor (UDisksDaemon *daemon);
-UDisksLinuxProvider *udisks_daemon_get_linux_provider (UDisksDaemon *daemon);
-UDisksFstabProvider *udisks_daemon_get_fstab_provider (UDisksDaemon *daemon);
-UDisksPersistentStore *udisks_daemon_get_persistent_store (UDisksDaemon *daemon);
-PolkitAuthority *udisks_daemon_get_authority (UDisksDaemon *daemon);
-UDisksBaseJob *udisks_daemon_launch_simple_job (UDisksDaemon *daemon,
- GCancellable *cancellable);
-UDisksBaseJob *udisks_daemon_launch_spawned_job (UDisksDaemon *daemon,
- GCancellable *cancellable,
- const gchar *input_string,
- const gchar *command_line_format,
- ...) G_GNUC_PRINTF (4, 5);
-gboolean udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon,
- GCancellable *cancellable,
- gchar **out_message,
- const gchar *input_string,
- const gchar *command_line_format,
- ...) G_GNUC_PRINTF (5, 6);
-UDisksBaseJob *udisks_daemon_launch_threaded_job (UDisksDaemon *daemon,
- UDisksThreadedJobFunc job_func,
- gpointer user_data,
- GDestroyNotify user_data_free_func,
- GCancellable *cancellable);
+GType udisks_daemon_get_type (void) G_GNUC_CONST;
+UDisksDaemon *udisks_daemon_new (GDBusConnection *connection);
+GDBusConnection *udisks_daemon_get_connection (UDisksDaemon *daemon);
+GDBusObjectManagerServer *udisks_daemon_get_object_manager (UDisksDaemon *daemon);
+UDisksMountMonitor *udisks_daemon_get_mount_monitor (UDisksDaemon *daemon);
+UDisksLinuxProvider *udisks_daemon_get_linux_provider (UDisksDaemon *daemon);
+UDisksFstabProvider *udisks_daemon_get_fstab_provider (UDisksDaemon *daemon);
+UDisksPersistentStore *udisks_daemon_get_persistent_store (UDisksDaemon *daemon);
+PolkitAuthority *udisks_daemon_get_authority (UDisksDaemon *daemon);
+UDisksBaseJob *udisks_daemon_launch_simple_job (UDisksDaemon *daemon,
+ GCancellable *cancellable);
+UDisksBaseJob *udisks_daemon_launch_spawned_job (UDisksDaemon *daemon,
+ GCancellable *cancellable,
+ const gchar *input_string,
+ const gchar *command_line_format,
+ ...) G_GNUC_PRINTF (4, 5);
+gboolean udisks_daemon_launch_spawned_job_sync (UDisksDaemon *daemon,
+ GCancellable *cancellable,
+ gchar **out_message,
+ const gchar *input_string,
+ const gchar *command_line_format,
+ ...) G_GNUC_PRINTF (5, 6);
+UDisksBaseJob *udisks_daemon_launch_threaded_job (UDisksDaemon *daemon,
+ UDisksThreadedJobFunc job_func,
+ gpointer user_data,
+ GDestroyNotify user_data_free_func,
+ GCancellable *cancellable);
/**
* UDisksLogLevel:
entry->object = g_dbus_object_stub_new (entry->object_path);
g_dbus_object_stub_add_interface (entry->object, G_DBUS_INTERFACE_STUB (entry->item));
- g_dbus_object_manager_export (udisks_daemon_get_object_manager (udisks_provider_get_daemon (UDISKS_PROVIDER (provider))),
- entry->object);
+ g_dbus_object_manager_server_export (udisks_daemon_get_object_manager (udisks_provider_get_daemon (UDISKS_PROVIDER (provider))),
+ entry->object);
exported = TRUE;
FstabEntry *entry)
{
g_assert (entry->object_path != NULL);
- g_dbus_object_manager_unexport (udisks_daemon_get_object_manager (udisks_provider_get_daemon (UDISKS_PROVIDER (provider))),
- entry->object_path);
+ g_dbus_object_manager_server_unexport (udisks_daemon_get_object_manager (udisks_provider_get_daemon (UDISKS_PROVIDER (provider))),
+ entry->object_path);
}
/* ---------------------------------------------------------------------------------------------------- */
}
static gchar *
-find_lun (GDBusObjectManager *object_manager,
- GUdevDevice *block_device)
+find_lun (GDBusObjectManagerServer *object_manager,
+ GUdevDevice *block_device)
{
const gchar *block_device_sysfs_path;
gchar *ret;
block_device_sysfs_path = g_udev_device_get_sysfs_path (block_device);
- objects = g_dbus_object_manager_get_all (object_manager);
+ objects = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (object_manager));
for (l = objects; l != NULL; l = l->next)
{
GDBusObjectStub *object = G_DBUS_OBJECT_STUB (l->data);
}
static gchar *
-find_block_device_by_sysfs_path (GDBusObjectManager *object_manager,
- const gchar *sysfs_path)
+find_block_device_by_sysfs_path (GDBusObjectManagerServer *object_manager,
+ const gchar *sysfs_path)
{
gchar *ret;
GList *objects;
ret = NULL;
- objects = g_dbus_object_manager_get_all (object_manager);
+ objects = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (object_manager));
for (l = objects; l != NULL; l = l->next)
{
GDBusObjectStub *object = G_DBUS_OBJECT_STUB (l->data);
{
UDisksBlockDevice *iface = UDISKS_BLOCK_DEVICE (_iface);
GUdevDeviceNumber dev;
- GDBusObjectManager *object_manager;
+ GDBusObjectManagerServer *object_manager;
gchar *lun_object_path;
gchar *s;
GList *mounts;
{
const gchar *vpd;
vpd = g_object_get_data (G_OBJECT (lun), "x-vpd");
- g_dbus_object_manager_unexport (udisks_daemon_get_object_manager (daemon),
- g_dbus_object_get_object_path (G_DBUS_OBJECT (lun)));
+ g_dbus_object_manager_server_unexport (udisks_daemon_get_object_manager (daemon),
+ g_dbus_object_get_object_path (G_DBUS_OBJECT (lun)));
g_warn_if_fail (g_hash_table_remove (provider->vpd_to_lun, vpd));
}
g_list_foreach (devices, (GFunc) g_object_unref, NULL);
if (lun != NULL)
{
g_object_set_data_full (G_OBJECT (lun), "x-vpd", g_strdup (vpd), g_free);
- g_dbus_object_manager_export_and_uniquify (udisks_daemon_get_object_manager (daemon),
- G_DBUS_OBJECT_STUB (lun));
+ g_dbus_object_manager_server_export_and_uniquify (udisks_daemon_get_object_manager (daemon),
+ G_DBUS_OBJECT_STUB (lun));
g_hash_table_insert (provider->vpd_to_lun, g_strdup (vpd), lun);
g_hash_table_insert (provider->sysfs_path_to_lun, g_strdup (sysfs_path), lun);
}
block = g_hash_table_lookup (provider->sysfs_to_block, sysfs_path);
if (block != NULL)
{
- g_dbus_object_manager_unexport (udisks_daemon_get_object_manager (daemon),
- g_dbus_object_get_object_path (G_DBUS_OBJECT (block)));
+ g_dbus_object_manager_server_unexport (udisks_daemon_get_object_manager (daemon),
+ g_dbus_object_get_object_path (G_DBUS_OBJECT (block)));
g_warn_if_fail (g_hash_table_remove (provider->sysfs_to_block, sysfs_path));
}
}
else
{
block = udisks_linux_block_new (daemon, device);
- g_dbus_object_manager_export_and_uniquify (udisks_daemon_get_object_manager (daemon),
- G_DBUS_OBJECT_STUB (block));
+ g_dbus_object_manager_server_export_and_uniquify (udisks_daemon_get_object_manager (daemon),
+ G_DBUS_OBJECT_STUB (block));
g_hash_table_insert (provider->sysfs_to_block, g_strdup (sysfs_path), block);
}
}
#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
#include <polkitagent/polkitagent.h>
-/* TODO: Temporary include */
-#include <gdbusproxymanager.h>
-
static UDisksClient *client = NULL;
-static GDBusProxyManager *manager = NULL;
static GMainLoop *loop = NULL;
/* Uncomment to get debug traces in /tmp/udisksctl-completion-debug.txt - use tail(1) to
gchar *s;
s = g_strdup_printf ("/org/freedesktop/UDisks2/%s", path);
- ret = g_dbus_proxy_manager_get_object (manager, s);
+ ret = g_dbus_object_manager_get_object (udisks_client_get_object_manager (client), s);
g_free (s);
return ret;
ret = NULL;
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
GDBusObject *object = G_DBUS_OBJECT (l->data);
full_lun_object_path = g_strdup_printf ("/org/freedesktop/UDisks2/LUNs/%s", lun);
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
GDBusObject *object = G_DBUS_OBJECT (l->data);
{
const gchar *object_path;
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
gboolean is_mounted;
if (complete_devices)
{
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
object = G_DBUS_OBJECT (l->data);
{
const gchar *object_path;
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
object = G_DBUS_OBJECT (l->data);
if (complete_devices)
{
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
object = G_DBUS_OBJECT (l->data);
if (complete_luns)
{
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
object = G_DBUS_OBJECT (l->data);
_color_run_pager ();
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
/* We want to print the objects in order */
objects = g_list_sort (objects, (GCompareFunc) obj_proxy_cmp);
first = TRUE;
{
gchar *name_owner;
gboolean ret;
- name_owner = g_dbus_proxy_manager_get_name_owner (manager);
+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (udisks_client_get_object_manager (client)));
ret = (name_owner != NULL);
g_free (name_owner);
return ret;
monitor_print_name_owner (void)
{
gchar *name_owner;
- name_owner = g_dbus_proxy_manager_get_name_owner (manager);
+ name_owner = g_dbus_object_manager_client_get_name_owner (G_DBUS_OBJECT_MANAGER_CLIENT (udisks_client_get_object_manager (client)));
monitor_print_timestamp ();
if (name_owner != NULL)
g_print ("The udisks-daemon is running (name-owner %s).\n", name_owner);
}
static void
-monitor_on_object_added (GDBusProxyManager *manager,
- GDBusObject *object,
- gpointer user_data)
+monitor_on_object_added (GDBusObjectManager *manager,
+ GDBusObject *object,
+ gpointer user_data)
{
if (!monitor_has_name_owner ())
goto out;
}
static void
-monitor_on_object_removed (GDBusProxyManager *manager,
- GDBusObject *object,
- gpointer user_data)
+monitor_on_object_removed (GDBusObjectManager *manager,
+ GDBusObject *object,
+ gpointer user_data)
{
if (!monitor_has_name_owner ())
goto out;
}
static void
-monitor_on_interface_proxy_added (GDBusProxyManager *manager,
- GDBusObject *object,
- GDBusProxy *interface_proxy,
- gpointer user_data)
+monitor_on_interface_proxy_added (GDBusObjectManager *manager,
+ GDBusObject *object,
+ GDBusInterface *interface,
+ gpointer user_data)
{
if (!monitor_has_name_owner ())
goto out;
g_dbus_object_get_object_path (object),
_color_get (_COLOR_RESET),
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_GREEN),
- g_dbus_proxy_get_interface_name (interface_proxy),
+ g_dbus_proxy_get_interface_name (G_DBUS_PROXY (interface)),
_color_get (_COLOR_RESET));
- print_interface_properties (interface_proxy, 2);
+ print_interface_properties (G_DBUS_PROXY (interface), 2);
out:
;
}
static void
-monitor_on_interface_proxy_removed (GDBusProxyManager *manager,
- GDBusObject *object,
- GDBusProxy *interface_proxy,
- gpointer user_data)
+monitor_on_interface_proxy_removed (GDBusObjectManager *manager,
+ GDBusObject *object,
+ GDBusInterface *interface,
+ gpointer user_data)
{
if (!monitor_has_name_owner ())
goto out;
g_dbus_object_get_object_path (object),
_color_get (_COLOR_RESET),
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_RED),
- g_dbus_proxy_get_interface_name (interface_proxy),
+ g_dbus_proxy_get_interface_name (G_DBUS_PROXY (interface)),
_color_get (_COLOR_RESET));
out:
;
}
static void
-monitor_on_interface_proxy_properties_changed (GDBusProxyManager *manager,
- GDBusObject *object,
- GDBusProxy *interface_proxy,
- GVariant *changed_properties,
- const gchar* const *invalidated_properties,
- gpointer user_data)
+monitor_on_interface_proxy_properties_changed (GDBusObjectManagerClient *manager,
+ GDBusObjectProxy *object_proxy,
+ GDBusProxy *interface_proxy,
+ GVariant *changed_properties,
+ const gchar* const *invalidated_properties,
+ gpointer user_data)
{
GVariantIter *iter;
const gchar *property_name;
g_print ("%s%s%s:%s %s%s%s:%s %s%sProperties Changed%s\n",
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_BLUE),
- g_dbus_object_get_object_path (object),
+ g_dbus_object_get_object_path (G_DBUS_OBJECT (object_proxy)),
_color_get (_COLOR_RESET),
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_MAGENTA),
g_dbus_proxy_get_interface_name (interface_proxy),
}
static void
-monitor_on_interface_proxy_signal (GDBusProxyManager *manager,
- GDBusObject *object,
- GDBusProxy *interface_proxy,
- const gchar *sender_name,
- const gchar *signal_name,
- GVariant *parameters,
- gpointer user_data)
+monitor_on_interface_proxy_signal (GDBusObjectManagerClient *manager,
+ GDBusObjectProxy *object_proxy,
+ GDBusProxy *interface_proxy,
+ const gchar *sender_name,
+ const gchar *signal_name,
+ GVariant *parameters,
+ gpointer user_data)
{
gchar *param_str;
if (!monitor_has_name_owner ())
g_print ("%s%s%s:%s %s%s%s%s%s%s::%s%s %s%s%s%s\n",
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_BLUE),
- g_dbus_object_get_object_path (object),
+ g_dbus_object_get_object_path (G_DBUS_OBJECT (object_proxy)),
_color_get (_COLOR_RESET),
_color_get (_COLOR_BOLD_ON), _color_get (_COLOR_FG_MAGENTA),
g_dbus_proxy_get_interface_name (interface_proxy),
gint ret;
GOptionContext *o;
gchar *s;
+ GDBusObjectManager *manager;
ret = 1;
g_print ("Monitoring the udisks daemon. Press Ctrl+C to exit.\n");
+ manager = udisks_client_get_object_manager (client);
g_signal_connect (manager,
"notify::name-owner",
G_CALLBACK (monitor_on_notify_name_owner),
if (request_completion)
goto out;
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
/* print all LUNs
*
ret = 1;
completion_cur = NULL;
completion_prev = NULL;
- manager = NULL;
loop = NULL;
g_type_init ();
g_error_free (error);
goto out;
}
- manager = udisks_client_get_proxy_manager (client);
request_completion = FALSE;
#include <udisks/udisks.h>
-/* TODO: Temporary include */
-#include <gdbusproxymanager.h>
-
-static GDBusObjectProxy *
-lookup_object_proxy_by_block_device_file (GDBusProxyManager *manager,
- const gchar *block_device_file)
+static GDBusObject *
+lookup_object_for_block_device_file (UDisksClient *client,
+ const gchar *block_device_file)
{
- GDBusObjectProxy *ret;
+ GDBusObject *ret;
GList *objects;
GList *l;
ret = NULL;
- objects = g_dbus_proxy_manager_get_objects (manager);
+ objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
for (l = objects; l != NULL; l = l->next)
{
- GDBusObjectProxy *object_proxy = G_DBUS_OBJECT_PROXY (l->data);
+ GDBusObject *object = G_DBUS_OBJECT (l->data);
UDisksBlockDevice *block;
- block = UDISKS_PEEK_BLOCK_DEVICE (object_proxy);
+ block = UDISKS_PEEK_BLOCK_DEVICE (object);
if (block != NULL)
{
const gchar * const *symlinks;
if (g_strcmp0 (udisks_block_device_get_device (block), block_device_file) == 0)
{
- ret = g_object_ref (object_proxy);
+ ret = g_object_ref (object);
goto out;
}
{
if (g_strcmp0 (symlinks[n], block_device_file) == 0)
{
- ret = g_object_ref (object_proxy);
+ ret = g_object_ref (object);
goto out;
}
}
{
gint ret;
gchar *block_device_file;
- GDBusProxyManager *manager;
+ UDisksClient *client;
GError *error;
struct stat statbuf;
- GDBusObjectProxy *object_proxy;
- UDisksBlockDevice *block;
+ GDBusObject *object;
const gchar *unmount_options[1] = {NULL};
ret = 1;
- manager = NULL;
+ client = NULL;
block_device_file = NULL;
- object_proxy = NULL;
- block = NULL;
+ object = NULL;
g_type_init ();
}
error = NULL;
- manager = udisks_proxy_manager_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_MANAGER_FLAGS_NONE,
- "org.freedesktop.UDisks2",
- "/org/freedesktop/UDisks2",
- NULL, /* GCancellable */
- &error);
- if (manager == NULL)
+ client = udisks_client_new_sync (NULL, /* GCancellable */
+ &error);
+ if (client == NULL)
{
g_printerr ("Error connecting to the udisks daemon: %s\n", error->message);
g_error_free (error);
goto out;
}
- object_proxy = lookup_object_proxy_by_block_device_file (manager, block_device_file);
- if (object_proxy == NULL)
+ object = lookup_object_for_block_device_file (client, block_device_file);
+ if (object == NULL)
{
g_printerr ("Error finding object for block device file %s\n", block_device_file);
goto out;
}
- block = UDISKS_PEEK_BLOCK_DEVICE (object_proxy);
-
error = NULL;
- if (!udisks_block_device_call_filesystem_unmount_sync (block,
+ if (!udisks_block_device_call_filesystem_unmount_sync (UDISKS_PEEK_BLOCK_DEVICE (object),
unmount_options,
NULL, /* GCancellable */
&error))
ret = 0;
out:
- if (object_proxy != NULL)
- g_object_unref (object_proxy);
+ if (object != NULL)
+ g_object_unref (object);
g_free (block_device_file);
- if (manager != NULL)
- g_object_unref (manager);
+ if (client != NULL)
+ g_object_unref (client);
return ret;
}
gboolean is_initialized;
GError *initialization_error;
- GDBusProxyManager *proxy_manager;
+ GDBusObjectManager *object_manager;
};
typedef struct
enum
{
PROP_0,
- PROP_PROXY_MANAGER
+ PROP_OBJECT_MANAGER
};
static void initable_iface_init (GInitableIface *initable_iface);
if (client->initialization_error != NULL)
g_error_free (client->initialization_error);
- g_object_unref (client->proxy_manager);
+ g_object_unref (client->object_manager);
G_OBJECT_CLASS (udisks_client_parent_class)->finalize (object);
}
switch (prop_id)
{
- case PROP_PROXY_MANAGER:
- g_value_set_object (value, udisks_client_get_proxy_manager (client));
+ case PROP_OBJECT_MANAGER:
+ g_value_set_object (value, udisks_client_get_object_manager (client));
break;
default:
gobject_class->get_property = udisks_client_get_property;
/**
- * UDisksClient:proxy-manager:
+ * UDisksClient:object-manager:
*
- * The #GDBusProxyManager used by the #UDisksClient instance.
+ * The #GDBusObjectManager used by the #UDisksClient instance.
*/
g_object_class_install_property (gobject_class,
- PROP_PROXY_MANAGER,
- g_param_spec_object ("proxy-manager",
- "proxy manager",
- "The #GDBusProxyManager used by the UDisksClient",
- G_TYPE_DBUS_PROXY_MANAGER,
+ PROP_OBJECT_MANAGER,
+ g_param_spec_object ("object-manager",
+ "object manager",
+ "The GDBusObjectManager used by the UDisksClient",
+ G_TYPE_DBUS_OBJECT_MANAGER,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
}
G_LOCK (init_lock);
if (client->is_initialized)
{
- if (client->proxy_manager != NULL)
+ if (client->object_manager != NULL)
ret = TRUE;
else
g_assert (client->initialization_error != NULL);
}
g_assert (client->initialization_error == NULL);
- client->proxy_manager = udisks_proxy_manager_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_MANAGER_FLAGS_NONE,
- "org.freedesktop.UDisks2",
- "/org/freedesktop/UDisks2",
- cancellable,
- &client->initialization_error);
- if (client->proxy_manager == NULL)
+ client->object_manager = udisks_object_manager_client_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
+ G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
+ "org.freedesktop.UDisks2",
+ "/org/freedesktop/UDisks2",
+ cancellable,
+ &client->initialization_error);
+ if (client->object_manager == NULL)
goto out;
ret = TRUE;
}
/**
- * udisks_client_get_proxy_manager:
+ * udisks_client_get_object_manager:
* @client: A #UDisksClient.
*
- * Gets the #GDBusProxyManager used by @client.
+ * Gets the #GDBusObjectManager used by @client.
*
- * Returns: (transfer none): A #GDBusProxyManager. Do not free, the
+ * Returns: (transfer none): A #GDBusObjectManager. Do not free, the
* instance is owned by @client.
*/
-GDBusProxyManager *
-udisks_client_get_proxy_manager (UDisksClient *client)
+GDBusObjectManager *
+udisks_client_get_object_manager (UDisksClient *client)
{
g_return_val_if_fail (UDISKS_IS_CLIENT (client), NULL);
- return client->proxy_manager;
+ return client->object_manager;
}
#define UDISKS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), UDISKS_TYPE_CLIENT, UDisksClient))
#define UDISKS_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), UDISKS_TYPE_CLIENT))
-GType udisks_client_get_type (void) G_GNUC_CONST;
-void udisks_client_new (GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-UDisksClient *udisks_client_new_finish (GAsyncResult *res,
- GError **error);
-UDisksClient *udisks_client_new_sync (GCancellable *cancellable,
- GError **error);
-GDBusProxyManager *udisks_client_get_proxy_manager (UDisksClient *client);
+GType udisks_client_get_type (void) G_GNUC_CONST;
+void udisks_client_new (GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+UDisksClient *udisks_client_new_finish (GAsyncResult *res,
+ GError **error);
+UDisksClient *udisks_client_new_sync (GCancellable *cancellable,
+ GError **error);
+GDBusObjectManager *udisks_client_get_object_manager (UDisksClient *client);
G_END_DECLS