aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-01-29 02:09:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-01-29 02:09:14 +0800
commitc2d0fb9b196b8cc93b4467f8872eea10e7e8b8c5 (patch)
treed7415cc3dbc628ed8f23f4431bdcfabcb99c2749 /mail/em-folder-tree-model.c
parentcd0f54e5465d95dfee6f4fb64d47a97301997dfe (diff)
downloadgsoc2013-evolution-c2d0fb9b196b8cc93b4467f8872eea10e7e8b8c5.tar.gz
gsoc2013-evolution-c2d0fb9b196b8cc93b4467f8872eea10e7e8b8c5.tar.zst
gsoc2013-evolution-c2d0fb9b196b8cc93b4467f8872eea10e7e8b8c5.zip
And thus completes the fixes for bug #52766.
2004-01-28 Jeffrey Stedfast <fejj@ximian.com> And thus completes the fixes for bug #52766. * em-folder-tree.c (tree_drag_drop): Don't call gtk_drag_get_data() manually here or we end up getting 2 drag-data-received callbacks which is Not Good (tm). * em-folder-tree-model.c (drop_folder): Now takes a moved argument to specify whether or not the contents were moved (the move argument is just a hint). (drop_uid_list): Same. (em_folder_tree_model_drag_data_received): Updated for the above api changes. svn path=/trunk/; revision=24497
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index cd0b1de9e0..989519c86b 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -949,12 +949,14 @@ em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *sto
/* Drag & Drop methods */
static void
-drop_uid_list (CamelFolder *dest, GtkSelectionData *selection, gboolean move, CamelException *ex)
+drop_uid_list (CamelFolder *dest, GtkSelectionData *selection, gboolean move, gboolean *moved, CamelException *ex)
{
CamelFolder *src;
GPtrArray *uids;
char *src_uri;
+ *moved = FALSE;
+
em_utils_selection_get_uidlist (selection, &src_uri, &uids);
if (!(src = mail_tool_uri_to_folder (src_uri, 0, ex))) {
@@ -968,13 +970,17 @@ drop_uid_list (CamelFolder *dest, GtkSelectionData *selection, gboolean move, Ca
camel_folder_transfer_messages_to (src, uids, dest, NULL, move, ex);
em_utils_uids_free (uids);
camel_object_unref (src);
+
+ *moved = move && !camel_exception_is_set (ex);
}
static void
-drop_folder (CamelFolder *dest, GtkSelectionData *selection, gboolean move, CamelException *ex)
+drop_folder (CamelFolder *dest, GtkSelectionData *selection, gboolean move, gboolean *moved, CamelException *ex)
{
CamelFolder *src;
+ *moved = FALSE;
+
/* get the folder being dragged */
if (!(src = mail_tool_uri_to_folder (selection->data, 0, ex)))
return;
@@ -988,6 +994,8 @@ drop_folder (CamelFolder *dest, GtkSelectionData *selection, gboolean move, Came
camel_store_rename_folder (dest->parent_store, old_name, new_name, ex);
+ *moved = !camel_exception_is_set (ex);
+
g_free (old_name);
g_free (new_name);
} else {
@@ -1151,14 +1159,12 @@ em_folder_tree_model_drag_data_received (EMFolderTreeModel *model, GtkTreePath *
switch (info) {
case DND_DROP_TYPE_UID_LIST:
/* import a list of uids from another evo folder */
- drop_uid_list (folder, selection, move, &ex);
- *moved = move;
+ drop_uid_list (folder, selection, move, moved, &ex);
d(printf ("\t* dropped a x-uid-list\n"));
break;
case DND_DROP_TYPE_FOLDER:
/* copy or move (aka rename) a folder */
- drop_folder (folder, selection, move, &ex);
- *moved = move;
+ drop_folder (folder, selection, move, moved, &ex);
d(printf ("\t* dropped a x-folder ('%s' into '%s')\n", selection->data, full_name));
break;
case DND_DROP_TYPE_MESSAGE_RFC822:
@@ -1177,8 +1183,8 @@ em_folder_tree_model_drag_data_received (EMFolderTreeModel *model, GtkTreePath *
}
if (camel_exception_is_set (&ex)) {
+ printf ("\t* exception: %s\n", ex.desc);
camel_exception_clear (&ex);
- *moved = FALSE;
return FALSE;
}