commit f80cda401dfd3b2d34e0d46282460d18f8e1c52c Author: Harald Judt Date: Thu Oct 25 22:04:00 2012 +0200 Tree view: Do not try to mount a device twice (bug #9412). diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index e5f8c57..e45fbb7 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -120,9 +120,6 @@ static gboolean thunar_tree_view_popup_menu (G static void thunar_tree_view_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column); -static gboolean thunar_tree_view_test_expand_row (GtkTreeView *tree_view, - GtkTreeIter *iter, - GtkTreePath *path); static void thunar_tree_view_row_collapsed (GtkTreeView *tree_view, GtkTreeIter *iter, GtkTreePath *path); @@ -298,7 +295,6 @@ thunar_tree_view_class_init (ThunarTreeViewClass *klass) gtktree_view_class = GTK_TREE_VIEW_CLASS (klass); gtktree_view_class->row_activated = thunar_tree_view_row_activated; - gtktree_view_class->test_expand_row = thunar_tree_view_test_expand_row; gtktree_view_class->row_collapsed = thunar_tree_view_row_collapsed; klass->delete_selected_files = thunar_tree_view_delete_selected_files; @@ -972,62 +968,6 @@ thunar_tree_view_row_activated (GtkTreeView *tree_view, -static gboolean -thunar_tree_view_test_expand_row (GtkTreeView *tree_view, - GtkTreeIter *iter, - GtkTreePath *path) -{ - ThunarTreeViewMountData *data; - GMountOperation *mount_operation; - ThunarTreeView *view = THUNAR_TREE_VIEW (tree_view); - GtkWidget *window; - gboolean expandable = TRUE; - ThunarDevice *device; - - /* determine the device for the iterator */ - gtk_tree_model_get (GTK_TREE_MODEL (view->model), iter, THUNAR_TREE_MODEL_COLUMN_DEVICE, &device, -1); - - /* check if we have a device */ - if (G_UNLIKELY (device != NULL)) - { - /* check if we need to mount the device first */ - if (!thunar_device_is_mounted (device)) - { - /* we need to mount the device before we can expand the row */ - expandable = FALSE; - - /* allocate a mount data struct */ - data = thunar_tree_view_mount_data_new (view, path, FALSE, FALSE); - - /* allocate a GTK+ mount operation */ - window = gtk_widget_get_toplevel (GTK_WIDGET (view)); - mount_operation = gtk_mount_operation_new (GTK_WINDOW (window)); - - /* try to mount the device and expand the row on success. the - * data is destroyed in the finish callback */ - thunar_device_mount (device, - mount_operation, - NULL, - thunar_tree_view_mount_finish, - data); - - /* release the mount operation */ - g_object_unref (mount_operation); - } - - /* release the device */ - g_object_unref (G_OBJECT (device)); - } - - /* cancel the cursor idle source if not expandable */ - if (!expandable && view->cursor_idle_id >= 0) - g_source_remove (view->cursor_idle_id); - - return !expandable; -} - - - static void thunar_tree_view_row_collapsed (GtkTreeView *tree_view, GtkTreeIter *iter,