|
|
4b6d7b |
diff -up evolution-3.12.11/addressbook/gui/widgets/e-addressbook-selector.c.contacts-drag-drop-vcard evolution-3.12.11/addressbook/gui/widgets/e-addressbook-selector.c
|
|
|
4b6d7b |
--- evolution-3.12.11/addressbook/gui/widgets/e-addressbook-selector.c.contacts-drag-drop-vcard 2014-07-17 12:48:07.000000000 +0200
|
|
|
4b6d7b |
+++ evolution-3.12.11/addressbook/gui/widgets/e-addressbook-selector.c 2015-06-08 12:56:07.117848545 +0200
|
|
|
4b6d7b |
@@ -57,7 +57,7 @@ enum {
|
|
|
4b6d7b |
};
|
|
|
4b6d7b |
|
|
|
4b6d7b |
static GtkTargetEntry drag_types[] = {
|
|
|
4b6d7b |
- { (gchar *) "text/x-source-vcard", 0, 0 }
|
|
|
4b6d7b |
+ { (gchar *) "text/x-source-vcard", 0, 1 }
|
|
|
4b6d7b |
};
|
|
|
4b6d7b |
|
|
|
4b6d7b |
G_DEFINE_TYPE (
|
|
|
4b6d7b |
@@ -297,6 +297,7 @@ addressbook_selector_data_dropped (ESour
|
|
|
4b6d7b |
MergeContext *merge_context;
|
|
|
4b6d7b |
EAddressbookModel *model;
|
|
|
4b6d7b |
EBookClient *source_client;
|
|
|
4b6d7b |
+ ESource *source_source = NULL;
|
|
|
4b6d7b |
ESourceRegistry *registry;
|
|
|
4b6d7b |
GSList *list;
|
|
|
4b6d7b |
const gchar *string;
|
|
|
4b6d7b |
@@ -310,16 +311,32 @@ addressbook_selector_data_dropped (ESour
|
|
|
4b6d7b |
|
|
|
4b6d7b |
registry = e_source_selector_get_registry (selector);
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- eab_source_and_contact_list_from_string (
|
|
|
4b6d7b |
- registry, string, NULL, &list);
|
|
|
4b6d7b |
+ if (info == drag_types[0].info)
|
|
|
4b6d7b |
+ eab_source_and_contact_list_from_string (
|
|
|
4b6d7b |
+ registry, string, &source_source, &list);
|
|
|
4b6d7b |
+ else
|
|
|
4b6d7b |
+ list = eab_contact_list_from_string (string);
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- if (list == NULL)
|
|
|
4b6d7b |
+ if (list == NULL) {
|
|
|
4b6d7b |
+ g_clear_object (&source_source);
|
|
|
4b6d7b |
return FALSE;
|
|
|
4b6d7b |
+ }
|
|
|
4b6d7b |
|
|
|
4b6d7b |
model = e_addressbook_view_get_model (priv->current_view);
|
|
|
4b6d7b |
source_client = e_addressbook_model_get_client (model);
|
|
|
4b6d7b |
g_return_val_if_fail (E_IS_BOOK_CLIENT (source_client), FALSE);
|
|
|
4b6d7b |
|
|
|
4b6d7b |
+ if (remove_from_source && source_source &&
|
|
|
4b6d7b |
+ !e_source_equal (source_source, e_client_get_source (E_CLIENT (source_client)))) {
|
|
|
4b6d7b |
+ g_warning ("%s: Source book '%s' doesn't match the view client '%s', skipping drop",
|
|
|
4b6d7b |
+ G_STRFUNC, e_source_get_uid (source_source),
|
|
|
4b6d7b |
+ e_source_get_uid (e_client_get_source (E_CLIENT (source_client))));
|
|
|
4b6d7b |
+ g_clear_object (&source_source);
|
|
|
4b6d7b |
+ return FALSE;
|
|
|
4b6d7b |
+ }
|
|
|
4b6d7b |
+
|
|
|
4b6d7b |
+ g_clear_object (&source_source);
|
|
|
4b6d7b |
+
|
|
|
4b6d7b |
merge_context = merge_context_new (
|
|
|
4b6d7b |
registry, g_object_ref (source_client), NULL, list);
|
|
|
4b6d7b |
merge_context->remove_from_source = remove_from_source;
|
|
|
4b6d7b |
diff -up evolution-3.12.11/addressbook/gui/widgets/e-minicard-view.c.contacts-drag-drop-vcard evolution-3.12.11/addressbook/gui/widgets/e-minicard-view.c
|
|
|
4b6d7b |
--- evolution-3.12.11/addressbook/gui/widgets/e-minicard-view.c.contacts-drag-drop-vcard 2014-03-24 10:25:23.000000000 +0100
|
|
|
4b6d7b |
+++ evolution-3.12.11/addressbook/gui/widgets/e-minicard-view.c 2015-06-08 12:56:07.117848545 +0200
|
|
|
4b6d7b |
@@ -106,7 +106,7 @@ e_minicard_view_drag_data_get (GtkWidget
|
|
|
4b6d7b |
EBookClient *book_client = NULL;
|
|
|
4b6d7b |
gchar *value;
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- g_object_get (view->adapter, "book_client", &book_client, NULL);
|
|
|
4b6d7b |
+ g_object_get (view->adapter, "client", &book_client, NULL);
|
|
|
4b6d7b |
value = eab_book_and_contact_list_to_string (book_client, view->drag_list);
|
|
|
4b6d7b |
|
|
|
4b6d7b |
gtk_selection_data_set (
|
|
|
4b6d7b |
@@ -140,8 +140,6 @@ e_minicard_view_drag_begin (EAddressbook
|
|
|
4b6d7b |
|
|
|
4b6d7b |
view->drag_list = e_minicard_view_get_card_list (view);
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- g_print ("dragging %d card(s)\n", g_slist_length (view->drag_list));
|
|
|
4b6d7b |
-
|
|
|
4b6d7b |
target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types));
|
|
|
4b6d7b |
|
|
|
4b6d7b |
context = gtk_drag_begin (
|
|
|
4b6d7b |
diff -up evolution-3.12.11/e-util/e-selection.c.contacts-drag-drop-vcard evolution-3.12.11/e-util/e-selection.c
|
|
|
4b6d7b |
--- evolution-3.12.11/e-util/e-selection.c.contacts-drag-drop-vcard 2014-03-24 10:25:23.000000000 +0100
|
|
|
4b6d7b |
+++ evolution-3.12.11/e-util/e-selection.c 2015-06-08 12:56:07.118848545 +0200
|
|
|
4b6d7b |
@@ -807,7 +807,7 @@ e_drag_dest_add_calendar_targets (GtkWid
|
|
|
4b6d7b |
|
|
|
4b6d7b |
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- target_list = gtk_drag_source_get_target_list (widget);
|
|
|
4b6d7b |
+ target_list = gtk_drag_dest_get_target_list (widget);
|
|
|
4b6d7b |
if (target_list != NULL)
|
|
|
4b6d7b |
gtk_target_list_ref (target_list);
|
|
|
4b6d7b |
else
|
|
|
4b6d7b |
@@ -824,7 +824,7 @@ e_drag_dest_add_directory_targets (GtkWi
|
|
|
4b6d7b |
|
|
|
4b6d7b |
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- target_list = gtk_drag_source_get_target_list (widget);
|
|
|
4b6d7b |
+ target_list = gtk_drag_dest_get_target_list (widget);
|
|
|
4b6d7b |
if (target_list != NULL)
|
|
|
4b6d7b |
gtk_target_list_ref (target_list);
|
|
|
4b6d7b |
else
|
|
|
4b6d7b |
@@ -841,7 +841,7 @@ e_drag_dest_add_html_targets (GtkWidget
|
|
|
4b6d7b |
|
|
|
4b6d7b |
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
4b6d7b |
|
|
|
4b6d7b |
- target_list = gtk_drag_source_get_target_list (widget);
|
|
|
4b6d7b |
+ target_list = gtk_drag_dest_get_target_list (widget);
|
|
|
4b6d7b |
if (target_list != NULL)
|
|
|
4b6d7b |
gtk_target_list_ref (target_list);
|
|
|
4b6d7b |
else
|