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 | |
parent | df6a8262a141e0bec824149e7f65568d2187c5c2 (diff) | |
download | gsoc2013-evolution-7ee6ef65f1019389c172478a80b8f0aa73a1453e.tar.gz 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')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.c | 26 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-selector.h | 6 |
2 files changed, 23 insertions, 9 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_); diff --git a/addressbook/gui/widgets/e-addressbook-selector.h b/addressbook/gui/widgets/e-addressbook-selector.h index f78442601d..67a2c8f6e5 100644 --- a/addressbook/gui/widgets/e-addressbook-selector.h +++ b/addressbook/gui/widgets/e-addressbook-selector.h @@ -34,13 +34,13 @@ (G_TYPE_CHECK_CLASS_CAST \ ((cls), E_TYPE_ADDRESSBOOK_SELECTOR, EAddressbookSelectorClass)) #define E_IS_ADDRESSBOOK_SELECTOR(obj) \ - (E_TYPE_CHECK_INSTANCE_TYPE \ + (G_TYPE_CHECK_INSTANCE_TYPE \ ((obj), E_TYPE_ADDRESSBOOK_SELECTOR)) #define E_IS_ADDRESSBOOK_SELECTOR_CLASS(cls) \ - (E_TYPE_CHECK_CLASS_TYPE \ + (G_TYPE_CHECK_CLASS_TYPE \ ((cls), E_TYPE_ADDRESSBOOK_SELECTOR)) #define E_ADDRESSBOOK_SELECTOR_GET_CLASS(obj) \ - (E_TYPE_INSTANCE_GET_CLASS \ + (G_TYPE_INSTANCE_GET_CLASS \ ((obj), E_TYPE_ADDRESSBOOK_SELECTOR, EAddressbookSelectorClass)) G_BEGIN_DECLS |