[gimp] app: gimp_get_image_window_iter() -> gimp_get_image_windows()



commit ca5fbf45d45080e7a993210a42cfd1c38e546607
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun Oct 25 20:31:55 2009 +0100

    app: gimp_get_image_window_iter() -> gimp_get_image_windows()
    
    Rename gimp_get_image_window_iter() to gimp_get_image_windows() and
    make it return a copy of the list of windows. Typically we will kill
    or create new windows when we use this function which is why we do a
    copy.

 app/core/gimp.c            |    4 ++--
 app/core/gimp.h            |    2 +-
 app/gui/gimpuiconfigurer.c |   18 ++++++++++--------
 3 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/app/core/gimp.c b/app/core/gimp.c
index 63dbb17..d741cb9 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -1020,11 +1020,11 @@ gimp_get_display_iter (Gimp *gimp)
 }
 
 GList *
-gimp_get_image_window_iter (Gimp *gimp)
+gimp_get_image_windows (Gimp *gimp)
 {
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
 
-  return gimp->image_windows;
+  return g_list_copy (gimp->image_windows);
 }
 
 GList *
diff --git a/app/core/gimp.h b/app/core/gimp.h
index 1d86bcf..31cd82f 100644
--- a/app/core/gimp.h
+++ b/app/core/gimp.h
@@ -171,7 +171,7 @@ void           gimp_exit                 (Gimp                *gimp,
 
 GList        * gimp_get_image_iter       (Gimp                *gimp);
 GList        * gimp_get_display_iter     (Gimp                *gimp);
-GList        * gimp_get_image_window_iter(Gimp                *gimp);
+GList        * gimp_get_image_windows    (Gimp                *gimp);
 GList        * gimp_get_tool_info_iter   (Gimp                *gimp);
 
 void           gimp_set_global_buffer    (Gimp                *gimp,
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 07fa00e..2a5352f 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -183,12 +183,11 @@ static void
 gimp_ui_configurer_configure_for_single_window (GimpUIConfigurer *ui_configurer)
 {
   Gimp    *gimp        = GIMP (ui_configurer->p->gimp);
+  GList   *windows     = gimp_get_image_windows (gimp);
   GList   *iter        = NULL;
   gboolean docks_moved = FALSE;
 
-  for (iter = gimp_get_image_window_iter (gimp);
-       iter;
-       iter = g_list_next (iter))
+  for (iter = windows; iter; iter = g_list_next (iter))
     {
       GimpImageWindow *image_window = GIMP_IMAGE_WINDOW (iter->data);
 
@@ -219,23 +218,26 @@ gimp_ui_configurer_configure_for_single_window (GimpUIConfigurer *ui_configurer)
       /* FIXME: Move all displays to a single window */
       gimp_image_window_set_show_docks (image_window, TRUE);
     }
+
+  g_list_free (windows);
 }
 
 static void
 gimp_ui_configurer_configure_for_multi_window (GimpUIConfigurer *ui_configurer)
 {
-  Gimp  *gimp = GIMP (ui_configurer->p->gimp);
-  GList *iter = NULL;
+  Gimp  *gimp    = GIMP (ui_configurer->p->gimp);
+  GList *windows = gimp_get_image_windows (gimp);
+  GList *iter    = NULL;
 
-  for (iter = gimp_get_image_window_iter (gimp);
-       iter;
-       iter = g_list_next (iter))
+  for (iter = windows; iter; iter = g_list_next (iter))
     {
       GimpImageWindow *image_window = GIMP_IMAGE_WINDOW (iter->data);
 
       /* FIXME: Move all displays to a multiple windows */
       gimp_image_window_set_show_docks (image_window, FALSE);
     }
+
+  g_list_free (windows);
 }
 
 void



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