From 0e3e684383975ced61e89be166969e69b5ef6689 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 26 Aug 2004 15:05:48 +0000 Subject: Fix for bug #63177 2004-08-24 Jeffrey Stedfast Fix for bug #63177 * em-folder-tree.c (emft_drop_async_drop): Check full_name == NULL rather than full_name[0] since store's have NULL full_names, not empty string (like they used to). (emft_drop_folder): Same. (tree_drag_data_received): Don't abort the drop if the user dropped on a store, this is allowed (depending on the store). svn path=/trunk/; revision=27035 --- mail/ChangeLog | 11 +++++++++++ mail/em-folder-tree.c | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index bfaeff0456..703593302c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2004-08-24 Jeffrey Stedfast + + Fix for bug #63177 + + * em-folder-tree.c (emft_drop_async_drop): Check full_name == NULL + rather than full_name[0] since store's have NULL full_names, not + empty string (like they used to). + (emft_drop_folder): Same. + (tree_drag_data_received): Don't abort the drop if the user + dropped on a store, this is allowed (depending on the store). + 2004-08-25 Not Zed * mail-component.c (store_info_new): only open the trash or junk diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 361675a43e..bd5ea3a369 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -857,7 +857,7 @@ emft_drop_folder(struct _DragDataReceivedAsync *m) return; /* handles dropping to the root properly */ - if (m->full_name[0]) + if (m->full_name) new_name = g_strdup_printf("%s/%s", m->full_name, src->name); else new_name = g_strdup(src->name); @@ -923,7 +923,7 @@ emft_drop_async_drop (struct _mail_msg *mm) if (m->info == DND_DROP_TYPE_FOLDER) { /* copy or move (aka rename) a folder */ emft_drop_folder(m); - } else if (m->full_name[0] == 0) { + } else if (m->full_name == NULL) { camel_exception_set (&mm->ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot drop message(s) into toplevel store")); } else if ((folder = camel_store_get_folder (m->store, m->full_name, 0, &mm->ex))) { @@ -1030,6 +1030,7 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y GtkTreeViewDropPosition pos; GtkTreePath *dest_path; struct _DragDataReceivedAsync *m; + gboolean is_store; CamelStore *store; GtkTreeIter iter; char *full_name; @@ -1051,11 +1052,11 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y gtk_tree_model_get((GtkTreeModel *)priv->model, &iter, COL_POINTER_CAMEL_STORE, &store, + COL_BOOL_IS_STORE, &is_store, COL_STRING_FULL_NAME, &full_name, -1); /* make sure user isn't try to drop on a placeholder row */ - /* FIXME: must allow drop of folders onto a store */ - if (full_name == NULL) { + if (full_name == NULL && !is_store) { gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME); return; } -- cgit v1.2.3