aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/memos-component.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/memos-component.c')
-rw-r--r--calendar/gui/memos-component.c50
1 files changed, 12 insertions, 38 deletions
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