diff options
-rw-r--r-- | shell/ChangeLog | 10 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 28 |
2 files changed, 36 insertions, 2 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 79b0d524ef..537d90be20 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,15 @@ 2001-10-02 Ettore Perazzoli <ettore@ximian.com> + [Don't allow dragging from a folder to one of its descendants or + onto itself, when the operation is GDK_DRAG_MOVE. This fixes bugs + like #8737.] + + * e-storage-set-view.c (handle_evolution_path_drag_motion): Don't + highlight if the user is attempting to move a folder to one of its + descendants. + +2001-10-02 Ettore Perazzoli <ettore@ximian.com> + * e-shell-view.c (e_shell_view_construct): Use `bonobo_ui_component_new_default()', not `bonobo_ui_component_new()'. diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 96b705954a..5e2e2284a0 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -995,16 +995,40 @@ handle_evolution_path_drag_motion (EStorageSetView *storage_set_view, GdkDragContext *context, unsigned int time) { + EStorageSetViewPrivate *priv; GdkModifierType modifiers; GdkDragAction action; + priv = storage_set_view->priv; + gdk_window_get_pointer (NULL, NULL, NULL, &modifiers); - if ((modifiers & GDK_CONTROL_MASK) != 0) + if ((modifiers & GDK_CONTROL_MASK) != 0) { action = GDK_ACTION_COPY; - else + } else { + GtkWidget *source_widget; + action = GDK_ACTION_MOVE; + source_widget = gtk_drag_get_source_widget (context); + if (source_widget != NULL + && E_IS_STORAGE_SET_VIEW (storage_set_view)) { + const char *source_path; + source_path = e_storage_set_view_get_current_folder (storage_set_view); + + if (source_path != NULL) { + int source_path_len; + const char *destination_path; + + source_path_len = strlen (path); + destination_path = e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path); + + if (strncmp (destination_path, source_path, source_path_len) == 0) + return FALSE; + } + } + } + e_tree_drag_highlight (E_TREE (storage_set_view), row, -1); gdk_drag_status (context, action, time); |