From 4f4615a46d5ba518c1e6a0c2412b1edf1e268d99 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 24 Nov 2008 05:14:44 +0000 Subject: Merge revisions 36737:36810 from trunk. svn path=/branches/kill-bonobo/; revision=36811 --- calendar/gui/memos-component.c | 50 ++++++++++-------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) (limited to 'calendar/gui/memos-component.c') diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index 45974af517..4edce662a6 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -218,43 +218,21 @@ update_objects (ECal *client, icalcomponent *icalcomp) return TRUE; } -static void -selector_tree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *data, - guint info, - guint time, - gpointer user_data) +static gboolean +selector_tree_data_dropped (ESourceSelector *selector, + GtkSelectionData *data, + ESource *destination, + GdkDragAction action, + guint info, + MemosComponent *component) { - GtkTreePath *path = NULL; - GtkTreeViewDropPosition pos; - gpointer source = NULL; - GtkTreeModel *model; - GtkTreeIter iter; gboolean success = FALSE; icalcomponent *icalcomp = NULL; ECal *client = NULL; GSList *components, *p; - MemosComponent *component = MEMOS_COMPONENT (user_data); - - if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), - x, y, &path, &pos)) - goto finish; - - model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - - if (!gtk_tree_model_get_iter (model, &iter, path)) - goto finish; - - - gtk_tree_model_get (model, &iter, 0, &source, -1); - - if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source) || !data->data) - goto finish; - client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); + client = auth_new_cal_from_source ( + destination, E_CAL_SOURCE_TYPE_JOURNAL); if (!client || !e_cal_open (client, TRUE, NULL)) goto finish; @@ -280,7 +258,7 @@ selector_tree_drag_data_received (GtkWidget *widget, continue; /* FIXME deal with GDK_ACTION_ASK */ - if (context->action == GDK_ACTION_COPY) { + if (action == GDK_ACTION_COPY) { old_uid = g_strdup (icalcomponent_get_uid (icalcomp)); uid = e_cal_component_gen_uid (); icalcomponent_set_uid (icalcomp, uid); @@ -297,7 +275,7 @@ selector_tree_drag_data_received (GtkWidget *widget, /* this will report success by last item, but we don't care */ success = update_objects (client, icalcomp); - if (success && context->action == GDK_ACTION_MOVE) { + if (success && action == GDK_ACTION_MOVE) { /* remove components rather here, because we know which has been moved */ ESource *source_source; ECal *source_client; @@ -337,12 +315,8 @@ selector_tree_drag_data_received (GtkWidget *widget, finish: if (client) g_object_unref (client); - if (source) - g_object_unref (source); - if (path) - gtk_tree_path_free (path); - gtk_drag_finish (context, success, success && context->action == GDK_ACTION_MOVE, time); + return success; } static void -- cgit v1.2.3