[gimp/gtk3-port: 288/386] app: remove all deprecated threads_enter/leave code



commit 2c91f377b1adc55dba0be898e5e4974cf43fcb00
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 2 15:10:01 2018 +0200

    app: remove all deprecated threads_enter/leave code

 app/app.c                            |    8 +++-----
 app/core/gimp-gui.c                  |   20 --------------------
 app/core/gimp-gui.h                  |    6 ------
 app/gui/gui-vtable.c                 |   17 -----------------
 app/plug-in/gimpplugin.c             |    2 --
 app/plug-in/gimppluginmanager-call.c |    4 ----
 6 files changed, 3 insertions(+), 54 deletions(-)
---
diff --git a/app/app.c b/app/app.c
index 85c178b..964f599 100644
--- a/app/app.c
+++ b/app/app.c
@@ -392,6 +392,7 @@ app_run (const gchar         *full_prog_name,
               g_object_unref (file);
             }
         }
+
       /* Delete backup XCF images. */
       for (iter = recovered_files; iter; iter = iter->next)
         {
@@ -419,6 +420,7 @@ app_run (const gchar         *full_prog_name,
             }
         }
     }
+
   if (font_error)
     {
       gimp_message_literal (gimp, NULL,
@@ -431,11 +433,7 @@ app_run (const gchar         *full_prog_name,
     gimp_batch_run (gimp, batch_interpreter, batch_commands);
 
   if (run_loop)
-    {
-      gimp_threads_leave (gimp);
-      g_main_loop_run (loop);
-      gimp_threads_enter (gimp);
-    }
+    g_main_loop_run (loop);
 
   if (gimp->be_verbose)
     g_print ("EXIT: %s\n", G_STRFUNC);
diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c
index 7c77b3d..77ac497 100644
--- a/app/core/gimp-gui.c
+++ b/app/core/gimp-gui.c
@@ -42,8 +42,6 @@ gimp_gui_init (Gimp *gimp)
   g_return_if_fail (GIMP_IS_GIMP (gimp));
 
   gimp->gui.ungrab                 = NULL;
-  gimp->gui.threads_enter          = NULL;
-  gimp->gui.threads_leave          = NULL;
   gimp->gui.set_busy               = NULL;
   gimp->gui.unset_busy             = NULL;
   gimp->gui.show_message           = NULL;
@@ -79,24 +77,6 @@ gimp_gui_ungrab (Gimp *gimp)
 }
 
 void
-gimp_threads_enter (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-
-  if (gimp->gui.threads_enter)
-    gimp->gui.threads_enter (gimp);
-}
-
-void
-gimp_threads_leave (Gimp *gimp)
-{
-  g_return_if_fail (GIMP_IS_GIMP (gimp));
-
-  if (gimp->gui.threads_leave)
-    gimp->gui.threads_leave (gimp);
-}
-
-void
 gimp_set_busy (Gimp *gimp)
 {
   g_return_if_fail (GIMP_IS_GIMP (gimp));
diff --git a/app/core/gimp-gui.h b/app/core/gimp-gui.h
index aa374df..f7c4f5c 100644
--- a/app/core/gimp-gui.h
+++ b/app/core/gimp-gui.h
@@ -25,9 +25,6 @@ struct _GimpGui
 {
   void           (* ungrab)                 (Gimp                *gimp);
 
-  void           (* threads_enter)          (Gimp                *gimp);
-  void           (* threads_leave)          (Gimp                *gimp);
-
   void           (* set_busy)               (Gimp                *gimp);
   void           (* unset_busy)             (Gimp                *gimp);
 
@@ -112,9 +109,6 @@ void           gimp_gui_init               (Gimp                *gimp);
 
 void           gimp_gui_ungrab             (Gimp                *gimp);
 
-void           gimp_threads_enter          (Gimp                *gimp);
-void           gimp_threads_leave          (Gimp                *gimp);
-
 GimpObject   * gimp_get_window_strategy    (Gimp                *gimp);
 GimpObject   * gimp_get_empty_display      (Gimp                *gimp);
 GimpObject   * gimp_get_display_by_ID      (Gimp                *gimp,
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index 3dfeec7..a2f7eaa 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -87,9 +87,6 @@
 
 static void           gui_ungrab                 (Gimp                *gimp);
 
-static void           gui_threads_enter          (Gimp                *gimp);
-static void           gui_threads_leave          (Gimp                *gimp);
-
 static void           gui_set_busy               (Gimp                *gimp);
 static void           gui_unset_busy             (Gimp                *gimp);
 
@@ -167,8 +164,6 @@ gui_vtable_init (Gimp *gimp)
   g_return_if_fail (GIMP_IS_GIMP (gimp));
 
   gimp->gui.ungrab                 = gui_ungrab;
-  gimp->gui.threads_enter          = gui_threads_enter;
-  gimp->gui.threads_leave          = gui_threads_leave;
   gimp->gui.set_busy               = gui_set_busy;
   gimp->gui.unset_busy             = gui_unset_busy;
   gimp->gui.show_message           = gui_message;
@@ -213,18 +208,6 @@ gui_ungrab (Gimp *gimp)
 }
 
 static void
-gui_threads_enter (Gimp *gimp)
-{
-  GDK_THREADS_ENTER ();
-}
-
-static void
-gui_threads_leave (Gimp *gimp)
-{
-  GDK_THREADS_LEAVE ();
-}
-
-static void
 gui_set_busy (Gimp *gimp)
 {
   gimp_displays_set_busy (gimp);
diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c
index 8869bc4..f0f852d 100644
--- a/app/plug-in/gimpplugin.c
+++ b/app/plug-in/gimpplugin.c
@@ -784,9 +784,7 @@ gimp_plug_in_main_loop (GimpPlugIn *plug_in)
 
   proc_frame->main_loop = g_main_loop_new (NULL, FALSE);
 
-  gimp_threads_leave (plug_in->manager->gimp);
   g_main_loop_run (proc_frame->main_loop);
-  gimp_threads_enter (plug_in->manager->gimp);
 
   g_clear_pointer (&proc_frame->main_loop, g_main_loop_unref);
 }
diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c
index a5a419f..f2defc3 100644
--- a/app/plug-in/gimppluginmanager-call.c
+++ b/app/plug-in/gimppluginmanager-call.c
@@ -256,9 +256,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
         {
           plug_in->ext_main_loop = g_main_loop_new (NULL, FALSE);
 
-          gimp_threads_leave (manager->gimp);
           g_main_loop_run (plug_in->ext_main_loop);
-          gimp_threads_enter (manager->gimp);
 
           /*  main_loop is quit in gimp_plug_in_handle_extension_ack()  */
 
@@ -274,9 +272,7 @@ gimp_plug_in_manager_call_run (GimpPlugInManager   *manager,
 
           proc_frame->main_loop = g_main_loop_new (NULL, FALSE);
 
-          gimp_threads_leave (manager->gimp);
           g_main_loop_run (proc_frame->main_loop);
-          gimp_threads_enter (manager->gimp);
 
           /*  main_loop is quit in gimp_plug_in_handle_proc_return()  */
 


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