Stop using deprecated glib eject functions.

This commit is contained in:
John Maguire 2011-10-26 11:51:11 +02:00
parent c8ca261b33
commit 01f3f5c5ea
1 changed files with 14 additions and 6 deletions

View File

@ -480,16 +480,26 @@ void GioLister::UnmountDevice(const QString &id) {
if (info.volume) { if (info.volume) {
if (g_volume_can_eject(info.volume)) { if (g_volume_can_eject(info.volume)) {
g_volume_eject(info.volume, G_MOUNT_UNMOUNT_NONE, NULL, g_volume_eject_with_operation(
(GAsyncReadyCallback) VolumeEjectFinished, NULL); info.volume,
G_MOUNT_UNMOUNT_NONE,
NULL,
NULL,
(GAsyncReadyCallback) VolumeEjectFinished,
NULL);
g_object_unref(info.volume); g_object_unref(info.volume);
return; return;
} }
} }
if (g_mount_can_eject(info.mount)) { if (g_mount_can_eject(info.mount)) {
g_mount_eject(info.mount, G_MOUNT_UNMOUNT_NONE, NULL, g_mount_eject_with_operation(
(GAsyncReadyCallback) MountEjectFinished, NULL); info.mount,
G_MOUNT_UNMOUNT_NONE,
NULL,
NULL,
(GAsyncReadyCallback) MountEjectFinished,
NULL);
} else if (g_mount_can_unmount(info.mount)) { } else if (g_mount_can_unmount(info.mount)) {
g_mount_unmount(info.mount, G_MOUNT_UNMOUNT_NONE, NULL, g_mount_unmount(info.mount, G_MOUNT_UNMOUNT_NONE, NULL,
(GAsyncReadyCallback) MountUnmountFinished, NULL); (GAsyncReadyCallback) MountUnmountFinished, NULL);
@ -554,5 +564,3 @@ void GioLister::DoMountDevice(const QString& id, int request_id) {
VolumeMountFinished, NULL); VolumeMountFinished, NULL);
emit DeviceMounted(id, request_id, true); emit DeviceMounted(id, request_id, true);
} }