[gimp] Bug 784305 - Deprecated enum constants are not registered in python-fu.



commit 7c32451dfbf1b22d2cec191062762e362b8ab261
Author: Massimo Valentini <mvalentini src gnome org>
Date:   Fri Jun 30 14:52:44 2017 +0200

    Bug 784305 - Deprecated enum constants are not registered in python-fu.

 libgimp/gimpenums.c.tail       |    2 ++
 libgimpbase/gimpbase-private.c |   18 ++++++++++++++++--
 libgimpbase/gimputils.h        |    2 ++
 tools/pdbgen/enumcode.pl       |    2 ++
 4 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail
index 12ca404..45ea762 100644
--- a/libgimp/gimpenums.c.tail
+++ b/libgimp/gimpenums.c.tail
@@ -174,6 +174,8 @@ gimp_enums_init (void)
   g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
                    (gpointer) gimp_layer_mode_effects_get_type ());
 
+  gimp_base_compat_enum_init ();
+
   enums_initialized = TRUE;
 }
 
diff --git a/libgimpbase/gimpbase-private.c b/libgimpbase/gimpbase-private.c
index ec39ffe..5e27152 100644
--- a/libgimpbase/gimpbase-private.c
+++ b/libgimpbase/gimpbase-private.c
@@ -27,6 +27,7 @@
 
 #include "gimpbase-private.h"
 #include "gimpcompatenums.h"
+#include "gimputils.h"
 
 
 GimpUnitVtable _gimp_unit_vtable = { NULL, };
@@ -36,7 +37,6 @@ void
 gimp_base_init (GimpUnitVtable *vtable)
 {
   static gboolean gimp_base_initialized = FALSE;
-  GQuark          quark;
 
   g_return_if_fail (vtable != NULL);
 
@@ -45,6 +45,20 @@ gimp_base_init (GimpUnitVtable *vtable)
 
   _gimp_unit_vtable = *vtable;
 
+  gimp_base_compat_enum_init ();
+
+  gimp_base_initialized = TRUE;
+}
+
+void
+gimp_base_compat_enum_init (void)
+{
+  static gboolean gimp_base_compat_initialized = FALSE;
+  GQuark          quark;
+
+  if (gimp_base_compat_initialized)
+    return;
+
   quark = g_quark_from_static_string ("gimp-compat-enum");
 
   g_type_set_qdata (GIMP_TYPE_ADD_MASK_TYPE, quark,
@@ -76,5 +90,5 @@ gimp_base_init (GimpUnitVtable *vtable)
   g_type_set_qdata (GIMP_TYPE_TRANSFER_MODE, quark,
                     (gpointer) GIMP_TYPE_TRANSFER_MODE_COMPAT);
 
-  gimp_base_initialized = TRUE;
+  gimp_base_compat_initialized = TRUE;
 }
diff --git a/libgimpbase/gimputils.h b/libgimpbase/gimputils.h
index c7cea29..a877472 100644
--- a/libgimpbase/gimputils.h
+++ b/libgimpbase/gimputils.h
@@ -70,6 +70,8 @@ const gchar   * gimp_flags_value_get_desc      (GFlagsClass  *flags_class,
                                                 GFlagsValue  *flags_value);
 const gchar   * gimp_flags_value_get_help      (GFlagsClass  *flags_class,
                                                 GFlagsValue  *flags_value);
+void            gimp_base_compat_enum_init     (void);
+
 
 
 G_END_DECLS
diff --git a/tools/pdbgen/enumcode.pl b/tools/pdbgen/enumcode.pl
index 999a7df..600ca3e 100755
--- a/tools/pdbgen/enumcode.pl
+++ b/tools/pdbgen/enumcode.pl
@@ -201,6 +201,8 @@ gimp_enums_init (void)
   g_type_set_qdata (GIMP_TYPE_LAYER_MODE, quark,
                    (gpointer) gimp_layer_mode_effects_get_type ());
 
+  gimp_base_compat_enum_init ();
+
   enums_initialized = TRUE;
 }
 


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