diff options
author | Milan Crha <mcrha@redhat.com> | 2011-01-25 19:50:02 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-25 23:27:37 +0800 |
commit | 2f65dede9fbf1ce24cc852f68de454a39f6ddda1 (patch) | |
tree | d511cbaf84ccb2091d9cfdc416572aa3803436c9 /widgets | |
parent | 006b4838e793cf935a7e2e372920277b71e3e518 (diff) | |
download | gsoc2013-evolution-2f65dede9fbf1ce24cc852f68de454a39f6ddda1.tar.gz gsoc2013-evolution-2f65dede9fbf1ce24cc852f68de454a39f6ddda1.tar.zst gsoc2013-evolution-2f65dede9fbf1ce24cc852f68de454a39f6ddda1.zip |
Bug #640517 - Runtime warnings when launching composer
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-picture-gallery.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/widgets/misc/e-picture-gallery.c b/widgets/misc/e-picture-gallery.c index 163a160ff8..209b00b662 100644 --- a/widgets/misc/e-picture-gallery.c +++ b/widgets/misc/e-picture-gallery.c @@ -327,9 +327,36 @@ visible_cb (EPictureGallery *gallery) static void picture_gallery_constructed (GObject *object) { + GtkIconView *icon_view; + GtkListStore *list_store; + GtkTargetEntry *targets; + GtkTargetList *list; + gint n_targets; + if (G_OBJECT_CLASS (e_picture_gallery_parent_class)->constructed) G_OBJECT_CLASS (e_picture_gallery_parent_class)->constructed (object); + icon_view = GTK_ICON_VIEW (object); + + list_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); + gtk_icon_view_set_model (icon_view, GTK_TREE_MODEL (list_store)); + g_object_unref (list_store); + + gtk_icon_view_set_pixbuf_column (icon_view, COL_PIXBUF); + gtk_icon_view_set_text_column (icon_view, COL_FILENAME_TEXT); + gtk_icon_view_set_tooltip_column (icon_view, -1); + + list = gtk_target_list_new (NULL, 0); + gtk_target_list_add_uri_targets (list, 0); + targets = gtk_target_table_new_from_list (list, &n_targets); + + gtk_icon_view_enable_model_drag_source ( + icon_view, GDK_BUTTON1_MASK, + targets, n_targets, GDK_ACTION_COPY); + + gtk_target_table_free (targets, n_targets); + gtk_target_list_unref (list); + g_signal_connect (object, "notify::visible", G_CALLBACK (visible_cb), NULL); } @@ -379,37 +406,10 @@ e_picture_gallery_class_init (EPictureGalleryClass *class) static void e_picture_gallery_init (EPictureGallery *gallery) { - GtkIconView *icon_view; - GtkListStore *list_store; - GtkTargetEntry *targets; - GtkTargetList *list; - gint n_targets; - gallery->priv = E_PICTURE_GALLERY_GET_PRIVATE (gallery); gallery->priv->initialized = FALSE; gallery->priv->monitor = NULL; picture_gallery_set_path (gallery, NULL); - - icon_view = GTK_ICON_VIEW (gallery); - - list_store = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); - gtk_icon_view_set_model (icon_view, GTK_TREE_MODEL (list_store)); - g_object_unref (list_store); - - gtk_icon_view_set_pixbuf_column (icon_view, COL_PIXBUF); - gtk_icon_view_set_text_column (icon_view, COL_FILENAME_TEXT); - gtk_icon_view_set_tooltip_column (icon_view, -1); - - list = gtk_target_list_new (NULL, 0); - gtk_target_list_add_uri_targets (list, 0); - targets = gtk_target_table_new_from_list (list, &n_targets); - - gtk_icon_view_enable_model_drag_source ( - icon_view, GDK_BUTTON1_MASK, - targets, n_targets, GDK_ACTION_COPY); - - gtk_target_table_free (targets, n_targets); - gtk_target_list_unref (list); } GtkWidget * |