void udisks_device_umount(const char *object_path) { DBusGProxy *proxy; proxy = dbus_g_proxy_new_for_name (dbus_bus, "org.freedesktop.UDisks", object_path, "org.freedesktop.UDisks.Device"); org_freedesktop_UDisks_Device_filesystem_unmount_async(proxy, NULL, udisks_device_umount_cb, NULL); }
static void g_udisks_mount_unmount_with_operation (GMount* base, GMountUnmountFlags flags, GMountOperation* mount_operation, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { GUDisksMount* mnt = G_UDISKS_MOUNT(base); if(mnt->vol) { GUDisksDevice* dev = mnt->vol->dev; GUDisksVolumeMonitor* mon = mnt->vol->mon; AsyncData* data = g_slice_new(AsyncData); DBusGProxy* proxy = g_udisks_device_get_proxy(dev, mon->con); data->mnt = g_object_ref(mnt); data->callback = callback; data->user_data = user_data; data->proxy = proxy; g_signal_emit_by_name(mon, "mount-pre-unmount", mnt); g_signal_emit_by_name(mnt, "pre-unmount"); data->call = org_freedesktop_UDisks_Device_filesystem_unmount_async( proxy, NULL, unmount_callback, data); if(cancellable) g_signal_connect(cancellable, "cancelled", G_CALLBACK(on_unmount_cancelled), data); } }