From b9719f9f3f82db26db320538c85bcfe5ba3f04a4 Mon Sep 17 00:00:00 2001 From: Eric Koegel Date: Mon, 16 Apr 2012 15:03:57 +0300 Subject: [PATCH] Switch away from deprecated glib/gio functions (Bug #8710) --- common/xfdesktop-common.c | 2 +- src/xfdesktop-volume-icon.c | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c index 64aee8d..d2534f6 100644 --- a/common/xfdesktop-common.c +++ b/common/xfdesktop-common.c @@ -338,7 +338,7 @@ xfdesktop_send_client_message(Window xid, const gchar *msg) gev.send_event = TRUE; gev.message_type = gdk_atom_intern("STRING", FALSE); gev.data_format = 8; - strcpy(gev.data.b, msg); + g_strlcpy(gev.data.b, msg, 20); gdk_event_send_client_message((GdkEvent *)&gev, (GdkNativeWindow)xid); gdk_flush(); diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c index 6447e10..734409b 100644 --- a/src/xfdesktop-volume-icon.c +++ b/src/xfdesktop-volume-icon.c @@ -473,7 +473,7 @@ xfdesktop_volume_icon_eject_finish(GObject *object, g_return_if_fail(G_IS_ASYNC_RESULT(result)); g_return_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon)); - if(!g_volume_eject_finish(volume, result, &error)) { + if(!g_volume_eject_with_operation_finish(volume, result, &error)) { /* ignore GIO errors handled internally */ if(error->domain != G_IO_ERROR || error->code != G_IO_ERROR_FAILED_HANDLED) { gchar *volume_name = g_volume_get_name(volume); @@ -515,7 +515,7 @@ xfdesktop_volume_icon_unmount_finish(GObject *object, g_return_if_fail(G_IS_ASYNC_RESULT(result)); g_return_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon)); - if(!g_mount_unmount_finish(mount, result, &error)) { + if(!g_mount_unmount_with_operation_finish(mount, result, &error)) { /* ignore GIO errors handled internally */ if(error->domain != G_IO_ERROR || error->code != G_IO_ERROR_FAILED_HANDLED) { gchar *mount_name = g_mount_get_name(mount); @@ -631,18 +631,22 @@ xfdesktop_volume_icon_menu_toggle_mount(GtkWidget *widget, #ifdef HAVE_LIBNOTIFY xfdesktop_notify_eject(volume); #endif - - g_volume_eject(volume, G_MOUNT_UNMOUNT_NONE, NULL, - xfdesktop_volume_icon_eject_finish, - g_object_ref(icon)); + /* TODO: GMountOperation could be used to show what processes + * are preventing an eject. */ + g_volume_eject_with_operation(volume, G_MOUNT_UNMOUNT_NONE, + NULL, NULL, + xfdesktop_volume_icon_eject_finish, + g_object_ref(icon)); } else { #ifdef HAVE_LIBNOTIFY xfdesktop_notify_unmount(mount); #endif - - g_mount_unmount(mount, G_MOUNT_UNMOUNT_NONE, NULL, - xfdesktop_volume_icon_unmount_finish, - g_object_ref(icon)); + /* TODO: GMountOperation could be used to show what processes + * are preventing an unmount. */ + g_mount_unmount_with_operation(mount, G_MOUNT_UNMOUNT_NONE, + NULL, NULL, + xfdesktop_volume_icon_unmount_finish, + g_object_ref(icon)); } } else { GMountOperation *operation; -- 1.7.5.4