gvfs r2354 - in trunk: . monitor/proxy
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r2354 - in trunk: . monitor/proxy
- Date: Tue, 31 Mar 2009 12:35:33 +0000 (UTC)
Author: alexl
Date: Tue Mar 31 12:35:33 2009
New Revision: 2354
URL: http://svn.gnome.org/viewvc/gvfs?rev=2354&view=rev
Log:
2009-03-31 Alexander Larsson <alexl redhat com>
Bug 567635 â flickering context menu item
* monitor/proxy/gproxyshadowmount.c:
Make sure we return the shadow object as the source_object
when wrapping the shadowed mounts operations.
Modified:
trunk/ChangeLog
trunk/monitor/proxy/gproxyshadowmount.c
Modified: trunk/monitor/proxy/gproxyshadowmount.c
==============================================================================
--- trunk/monitor/proxy/gproxyshadowmount.c (original)
+++ trunk/monitor/proxy/gproxyshadowmount.c Tue Mar 31 12:35:33 2009
@@ -300,19 +300,34 @@
GObject *object;
GAsyncReadyCallback callback;
gpointer user_data;
-} EjectWrapperOp;
+} AsyncWrapperOp;
static void
-eject_wrapper_callback (GObject *source_object,
+async_wrapper_callback (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
- EjectWrapperOp *data = user_data;
+ AsyncWrapperOp *data = user_data;
data->callback (data->object, res, data->user_data);
g_object_unref (data->object);
g_free (data);
}
+static AsyncWrapperOp *
+setup_async_wrapper (GMount *mount,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ AsyncWrapperOp *data;
+
+ data = g_new0 (AsyncWrapperOp, 1);
+ data->object = g_object_ref (mount);
+ data->callback = callback;
+ data->user_data = user_data;
+ return data;
+}
+
+
static void
g_proxy_shadow_mount_eject (GMount *mount,
GMountUnmountFlags flags,
@@ -321,14 +336,13 @@
gpointer user_data)
{
GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount);
- EjectWrapperOp *data;
+ AsyncWrapperOp *data;
+ data = setup_async_wrapper (mount, callback, user_data);
G_LOCK (proxy_shadow_mount);
- data = g_new0 (EjectWrapperOp, 1);
- data->object = g_object_ref (mount);
- data->callback = callback;
- data->user_data = user_data;
- g_volume_eject (G_VOLUME (proxy_shadow_mount->volume), flags, cancellable, eject_wrapper_callback, data);
+ g_volume_eject (G_VOLUME (proxy_shadow_mount->volume),
+ flags, cancellable,
+ async_wrapper_callback, data);
G_UNLOCK (proxy_shadow_mount);
}
@@ -355,12 +369,13 @@
gpointer user_data)
{
GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount);
+ AsyncWrapperOp *data;
+ data = setup_async_wrapper (mount, callback, user_data);
g_mount_unmount (proxy_shadow_mount->real_mount,
flags,
cancellable,
- callback,
- user_data);
+ async_wrapper_callback, data);
}
static gboolean
@@ -383,12 +398,13 @@
gpointer user_data)
{
GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount);
+ AsyncWrapperOp *data;
+ data = setup_async_wrapper (mount, callback, user_data);
g_mount_guess_content_type (proxy_shadow_mount->real_mount,
force_rescan,
cancellable,
- callback,
- user_data);
+ async_wrapper_callback, data);
}
static char **
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]