aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-07 07:23:57 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-09 02:53:45 +0800
commitfa9051e04051156a9e11e2af72a0d7342f4ea2e4 (patch)
tree0d064bddb366257c660722359dc33f5ef3c610c7 /widgets/misc/e-attachment-view.c
parentc9e7aa7aee6b407659843131cc8becdafa71992a (diff)
downloadgsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.gz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.bz2
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.lz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.xz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.zst
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.zip
Finish killing Bonobo.
Diffstat (limited to 'widgets/misc/e-attachment-view.c')
-rw-r--r--widgets/misc/e-attachment-view.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/widgets/misc/e-attachment-view.c b/widgets/misc/e-attachment-view.c
index 17a2b6c9b4..cd5301a987 100644
--- a/widgets/misc/e-attachment-view.c
+++ b/widgets/misc/e-attachment-view.c
@@ -682,12 +682,30 @@ attachment_view_update_actions (EAttachmentView *view)
}
static void
+attachment_view_add_handler (GType type,
+ EAttachmentView *view)
+{
+ EAttachmentViewPrivate *priv;
+ EAttachmentHandler *handler;
+ const GtkTargetEntry *targets;
+ guint n_targets;
+
+ priv = e_attachment_view_get_private (view);
+
+ handler = g_object_new (type, "view", view, NULL);
+
+ targets = e_attachment_handler_get_target_table (handler, &n_targets);
+ gtk_target_list_add_table (priv->target_list, targets, n_targets);
+ priv->drag_actions = e_attachment_handler_get_drag_actions (handler);
+
+ g_ptr_array_add (priv->handlers, handler);
+}
+
+static void
attachment_view_init_handlers (EAttachmentView *view)
{
EAttachmentViewPrivate *priv;
GtkTargetList *target_list;
- GType *children;
- guint ii;
priv = e_attachment_view_get_private (view);
@@ -700,25 +718,9 @@ attachment_view_init_handlers (EAttachmentView *view)
priv->target_list = target_list;
priv->drag_actions = GDK_ACTION_COPY;
- children = g_type_children (E_TYPE_ATTACHMENT_HANDLER, NULL);
-
- for (ii = 0; children[ii] != G_TYPE_INVALID; ii++) {
- EAttachmentHandler *handler;
- const GtkTargetEntry *targets;
- guint n_targets;
-
- handler = g_object_new (children[ii], "view", view, NULL);
-
- targets = e_attachment_handler_get_target_table (
- handler, &n_targets);
- gtk_target_list_add_table (target_list, targets, n_targets);
- priv->drag_actions |=
- e_attachment_handler_get_drag_actions (handler);
-
- g_ptr_array_add (priv->handlers, handler);
- }
-
- g_free (children);
+ e_type_traverse (
+ E_TYPE_ATTACHMENT_HANDLER, (ETypeFunc)
+ attachment_view_add_handler, view);
}
static void