[gimp] app: remove gimp_display_shell_filter_new(), it's empty and useless



commit ec18b969a3a66da2e8579e042dbda4244811e3b3
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jul 25 09:55:55 2019 +0200

    app: remove gimp_display_shell_filter_new(), it's empty and useless

 app/display/gimpdisplayshell-filter.c | 42 +----------------------------------
 app/display/gimpdisplayshell-filter.h |  3 ---
 app/display/gimpdisplayshell.c        | 34 +++++++++-------------------
 3 files changed, 12 insertions(+), 67 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-filter.c b/app/display/gimpdisplayshell-filter.c
index df9c3d7637..4c5ed3e5f0 100644
--- a/app/display/gimpdisplayshell-filter.c
+++ b/app/display/gimpdisplayshell-filter.c
@@ -54,16 +54,12 @@ gimp_display_shell_filter_set (GimpDisplayShell      *shell,
       g_signal_handlers_disconnect_by_func (shell->filter_stack,
                                             gimp_display_shell_filter_changed,
                                             shell);
-
-      g_object_unref (shell->filter_stack);
     }
 
-  shell->filter_stack = stack;
+  g_set_object (&shell->filter_stack, stack);
 
   if (shell->filter_stack)
     {
-      g_object_ref (shell->filter_stack);
-
       g_signal_connect (shell->filter_stack, "changed",
                         G_CALLBACK (gimp_display_shell_filter_changed),
                         shell);
@@ -94,42 +90,6 @@ gimp_display_shell_has_filter (GimpDisplayShell *shell)
   return FALSE;
 }
 
-GimpColorDisplayStack *
-gimp_display_shell_filter_new (GimpDisplayShell *shell)
-{
-  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
-
-#if 0
-  /*  disabled because we use gimpdisplayshell-profile now, keep
-   *  the code around for reference.
-   */
-  if (config->display_module)
-    {
-      GType type = g_type_from_name (config->display_module);
-
-      if (g_type_is_a (type, GIMP_TYPE_COLOR_DISPLAY))
-        {
-          GimpColorDisplay      *display;
-          GimpColorDisplayStack *stack;
-
-          display = g_object_new (type,
-                                  "color-config",  config,
-                                  "color-managed", shell,
-                                  NULL);
-
-          stack = gimp_color_display_stack_new ();
-
-          gimp_color_display_stack_add (stack, display);
-          g_object_unref (display);
-
-          return stack;
-        }
-    }
-#endif
-
-  return NULL;
-}
-
 
 /*  private functions  */
 
diff --git a/app/display/gimpdisplayshell-filter.h b/app/display/gimpdisplayshell-filter.h
index 61cba6069f..7543a8b8b5 100644
--- a/app/display/gimpdisplayshell-filter.h
+++ b/app/display/gimpdisplayshell-filter.h
@@ -24,8 +24,5 @@ void       gimp_display_shell_filter_set (GimpDisplayShell      *shell,
 
 gboolean   gimp_display_shell_has_filter (GimpDisplayShell      *shell);
 
-GimpColorDisplayStack *
-           gimp_display_shell_filter_new (GimpDisplayShell      *shell);
-
 
 #endif /* __GIMP_DISPLAY_SHELL_FILTER_H__ */
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index e46b89b781..c567475289 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -394,17 +394,16 @@ gimp_display_shell_init (GimpDisplayShell *shell)
 static void
 gimp_display_shell_constructed (GObject *object)
 {
-  GimpDisplayShell      *shell = GIMP_DISPLAY_SHELL (object);
-  GimpDisplayConfig     *config;
-  GimpImage             *image;
-  GimpColorDisplayStack *filter;
-  GtkWidget             *grid;
-  GtkWidget             *gtk_image;
-  GimpAction            *action;
-  gint                   image_width;
-  gint                   image_height;
-  gint                   shell_width;
-  gint                   shell_height;
+  GimpDisplayShell  *shell = GIMP_DISPLAY_SHELL (object);
+  GimpDisplayConfig *config;
+  GimpImage         *image;
+  GtkWidget         *grid;
+  GtkWidget         *gtk_image;
+  GimpAction        *action;
+  gint               image_width;
+  gint               image_height;
+  gint               shell_width;
+  gint               shell_height;
 
   G_OBJECT_CLASS (parent_class)->constructed (object);
 
@@ -687,16 +686,6 @@ gimp_display_shell_constructed (GObject *object)
   /*  show everything that is always shown */
   gtk_widget_show (GTK_WIDGET (shell->canvas));
 
-  /*  add display filters  */
-
-  filter = gimp_display_shell_filter_new (shell);
-
-  if (filter)
-    {
-      gimp_display_shell_filter_set (shell, filter);
-      g_object_unref (filter);
-    }
-
   if (image)
     {
       gimp_display_shell_connect (shell);
@@ -738,8 +727,7 @@ gimp_display_shell_dispose (GObject *object)
   if (shell->selection)
     gimp_display_shell_selection_free (shell);
 
-  if (shell->filter_stack)
-    gimp_display_shell_filter_set (shell, NULL);
+  gimp_display_shell_filter_set (shell, NULL);
 
   if (shell->filter_idle_id)
     {


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