diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-13 12:02:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-13 12:02:09 +0800 |
commit | 7ee6ef65f1019389c172478a80b8f0aa73a1453e (patch) | |
tree | e50bcb96372f1fbbe5b53fc64b8200932ef7659d /addressbook/gui/widgets/e-addressbook-selector.c | |
parent | df6a8262a141e0bec824149e7f65568d2187c5c2 (diff) | |
download | gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.gz gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.bz2 gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.lz gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.xz gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.zst gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.zip |
Allow EShellContent, EShellSidebar, and EShellTaskbar to be subclassed,
and begin doing so for Calendars, Memos and Tasks. Makes the code cleaner.
svn path=/branches/kill-bonobo/; revision=36317
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-selector.c')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c index e071e948f4..dfd0e32a7a 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.c +++ b/addressbook/gui/widgets/e-addressbook-selector.c @@ -147,6 +147,9 @@ addressbook_selector_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time_) { + /* XXX This is exactly the same as in ECalendarSelector. + * Consider merging this callback into ESourceSelector. */ + GtkTreeView *tree_view; GtkTreeViewDropPosition pos; @@ -163,6 +166,9 @@ addressbook_selector_drag_motion (GtkWidget *widget, gint y, guint time_) { + /* XXX This is exactly the same as in ECalendarSelector. + * Consider merging this callback into ESourceSelector. */ + GtkTreeView *tree_view; GtkTreeModel *model; GtkTreePath *path = NULL; @@ -201,9 +207,9 @@ exit: gtk_tree_path_free (path); if (object != NULL) - g_object_ref (object); + g_object_unref (object); - gdk_drag_status (context, action, GDK_CURRENT_TIME); + gdk_drag_status (context, action, time_); return TRUE; } @@ -215,6 +221,9 @@ addressbook_selector_drag_drop (GtkWidget *widget, gint y, guint time_) { + /* XXX This is exactly the same as in ECalendarSelector. + * Consider merging this callback into ESourceSelector. */ + GtkTreeView *tree_view; GtkTreeModel *model; GtkTreePath *path; @@ -235,7 +244,7 @@ addressbook_selector_drag_drop (GtkWidget *widget, g_return_val_if_fail (valid, FALSE); gtk_tree_model_get (model, &iter, 0, &object, -1); - drop_zone = !E_IS_SOURCE_GROUP (object); + drop_zone = E_IS_SOURCE (object); g_object_unref (object); return drop_zone; @@ -250,6 +259,11 @@ addressbook_selector_drag_data_received (GtkWidget *widget, guint info, guint time_) { + /* XXX This is NEARLY the same as in ECalendarSelector. + * Consider merging this callback into ESourceSelector. + * Use a callback to allow subclasses to handle the + * received selection data. */ + MergeContext *merge_context; GtkTreeView *tree_view; GtkTreeModel *model; @@ -266,7 +280,7 @@ addressbook_selector_drag_data_received (GtkWidget *widget, tree_view = GTK_TREE_VIEW (widget); model = gtk_tree_view_get_model (tree_view); - string = (gchar *) selection_data->data; + string = (const gchar *) selection_data->data; remove_from_source = (context->action == GDK_ACTION_MOVE); if (!gtk_tree_view_get_dest_row_at_pos (tree_view, x, y, &path, NULL)) @@ -303,10 +317,10 @@ addressbook_selector_drag_data_received (GtkWidget *widget, success = TRUE; exit: - if (path) + if (path != NULL) gtk_tree_path_free (path); - if (object) + if (object != NULL) g_object_unref (object); gtk_drag_finish (context, success, remove_from_source, time_); |