summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-mime-actions.c
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2008-04-04 14:53:07 +0000
committerChristian Neumair <cneumair@src.gnome.org>2008-04-04 14:53:07 +0000
commit00a42fe81d10c8aec34afd1f9ebf5551ee51a44b (patch)
tree4f572bd862c7f3ca383697051ac950a20a92fbb2 /libnautilus-private/nautilus-mime-actions.c
parent9ed118a9c7dc3966ec0d7ce1ce0936e1d577965d (diff)
downloadnautilus-00a42fe81d10c8aec34afd1f9ebf5551ee51a44b.tar.gz
Inhibit autorun in mount callbacks after finishing mounts rather than
2008-04-04 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-file-operations.c (volume_mount_cb), (nautilus_file_operations_mount_volume): * libnautilus-private/nautilus-file-operations.h: * libnautilus-private/nautilus-mime-actions.c (activation_mount_not_mounted_callback), (activation_mount_not_mounted): * src/nautilus-application.c (startup_volume_mount_cb), (automount_all_volumes), (volume_added_callback): * src/nautilus-places-sidebar.c (open_selected_bookmark), (mount_shortcut_cb): * src/nautilus-window-manage-views.c (mount_not_mounted_callback), (got_file_info_for_view_selection_callback): Inhibit autorun in mount callbacks after finishing mounts rather than before mounting. It is neccessary because the mount may take a very long time (floppy, password prompt), which may take longer than the inhibition timeout. This approach works because with the current HAL volume monitor implementation, GVolumeMonitor signal emission is scheduled, while the mount callbacks are invoked synchronously. This should also fix the not working inhibition on startup, which could happen because parallel mounts in the background and the rest of the startup process eat resources, so the mounts may also take longer than the inhibition timeout. svn path=/trunk/; revision=14034
Diffstat (limited to 'libnautilus-private/nautilus-mime-actions.c')
-rw-r--r--libnautilus-private/nautilus-mime-actions.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c
index 74f573a92..fb13c0d1c 100644
--- a/libnautilus-private/nautilus-mime-actions.c
+++ b/libnautilus-private/nautilus-mime-actions.c
@@ -1235,6 +1235,7 @@ activation_mount_not_mounted_callback (GObject *source_object,
ActivateParameters *parameters = user_data;
GError *error;
NautilusFile *file;
+ GFile *location;
file = parameters->not_mounted->data;
@@ -1255,6 +1256,10 @@ activation_mount_not_mounted_callback (GObject *source_object,
}
g_error_free (error);
+ } else {
+ location = nautilus_file_get_location (file);
+ nautilus_inhibit_autorun_for_file (location);
+ g_object_unref (G_OBJECT (location));
}
parameters->not_mounted = g_list_delete_link (parameters->not_mounted,
@@ -1276,7 +1281,6 @@ activation_mount_not_mounted (ActivateParameters *parameters)
mount_op = eel_mount_operation_new (parameters->parent_window);
g_signal_connect (mount_op, "active_changed", (GCallback)activate_mount_op_active, parameters);
location = nautilus_file_get_location (file);
- nautilus_inhibit_autorun_for_file (location);
g_file_mount_enclosing_volume (location, 0, mount_op, parameters->cancellable,
activation_mount_not_mounted_callback, parameters);
g_object_unref (location);