[gimp] Use gimp_image_get_channels() instead of image->channels



commit 72cfe6c701bd17c5b4cf74f5cba2f7bdf00903e9
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 2 13:03:52 2009 +0200

    Use gimp_image_get_channels() instead of image->channels

 app/dialogs/layer-add-mask-dialog.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/dialogs/layer-add-mask-dialog.c b/app/dialogs/layer-add-mask-dialog.c
index c5d8f99..1897f60 100644
--- a/app/dialogs/layer-add-mask-dialog.c
+++ b/app/dialogs/layer-add-mask-dialog.c
@@ -64,6 +64,7 @@ layer_add_mask_dialog_new (GimpLayer       *layer,
   GtkWidget          *frame;
   GtkWidget          *combo;
   GtkWidget          *button;
+  GimpImage          *image;
   GimpChannel        *channel;
 
   g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
@@ -118,7 +119,9 @@ layer_add_mask_dialog_new (GimpLayer       *layer,
   gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
   gtk_widget_show (frame);
 
-  combo = gimp_container_combo_box_new (gimp_item_get_image (GIMP_ITEM (layer))->channels,
+  image = gimp_item_get_image (GIMP_ITEM (layer));
+
+  combo = gimp_container_combo_box_new (gimp_image_get_channels (image),
                                         context,
                                         GIMP_VIEW_SIZE_SMALL, 1);
   gimp_enum_radio_frame_add (GTK_FRAME (frame), combo,
@@ -129,10 +132,10 @@ layer_add_mask_dialog_new (GimpLayer       *layer,
                     G_CALLBACK (layer_add_mask_dialog_channel_selected),
                     dialog);
 
-  channel = gimp_image_get_active_channel (gimp_item_get_image (GIMP_ITEM (layer)));
+  channel = gimp_image_get_active_channel (image);
 
   if (! channel)
-    channel = GIMP_CHANNEL (gimp_container_get_first_child (gimp_item_get_image (GIMP_ITEM (layer))->channels));
+    channel = GIMP_CHANNEL (gimp_container_get_first_child (gimp_image_get_channels (image)));
 
   gimp_container_view_select_item (GIMP_CONTAINER_VIEW (combo),
                                    GIMP_VIEWABLE (channel));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]