aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2010-05-19 22:22:23 +0800
committerMichael Meeks <michael.meeks@novell.com>2010-05-19 22:22:23 +0800
commit9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1 (patch)
treee4815398dbd17e1b87f8bf220b106e5a017e1179 /mail/em-folder-tree.c
parent2566a8549d7fd878226aeb9269f2d5871a5eddc2 (diff)
parentea1a5fca456b891f8bb9ab248ad65651b66b54b2 (diff)
downloadgsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.gz
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.bz2
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.lz
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.xz
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.tar.zst
gsoc2013-evolution-9a718fdc54a11ffc2dfe90a1c03d832fe151c2e1.zip
Merge commit 'origin/express2' into express2
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index b1f204df4b..fdd1b88ee0 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1786,11 +1786,14 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
GtkTreePath *src_path = gtk_tree_row_reference_get_path(p->drag_row);
if (src_path) {
+ guint32 src_flags = 0;
+
if (gtk_tree_model_get_iter (model, &iter, src_path))
gtk_tree_model_get (
model, &iter,
COL_POINTER_CAMEL_STORE, &sstore,
- COL_STRING_URI, &src_uri, -1);
+ COL_STRING_URI, &src_uri,
+ COL_UINT_FLAGS, &src_flags, -1);
/* can't dnd onto itself or below itself - bad things happen,
no point dragging to where we were either */
@@ -1803,6 +1806,26 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
}
gtk_tree_path_free(src_path);
+
+ if ((src_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || (src_flags & CAMEL_FOLDER_SYSTEM) != 0) {
+ /* allow only copy of the Inbox and other system folders */
+ GdkAtom xfolder;
+
+ /* TODO: not sure if this is legal, but it works, force copy for special local folders */
+ context->suggested_action = GDK_ACTION_COPY;
+ context->actions = GDK_ACTION_COPY;
+ xfolder = drop_atoms[DND_DROP_TYPE_FOLDER];
+ while (targets != NULL) {
+ if (targets->data == (gpointer) xfolder) {
+ atom = xfolder;
+ goto done;
+ }
+
+ targets = targets->next;
+ }
+
+ goto done;
+ }
}
}
@@ -1824,6 +1847,7 @@ folder_tree_drop_target(EMFolderTree *folder_tree, GdkDragContext *context, GtkT
/* TODO: not sure if this is legal, but it works, force copy for special local folders */
context->suggested_action = GDK_ACTION_COPY;
+ context->actions = GDK_ACTION_COPY;
xfolder = drop_atoms[DND_DROP_TYPE_FOLDER];
while (targets != NULL) {
if (targets->data == (gpointer) xfolder) {