[gtk/matthiasc/for-master] builder: Drop unused part of private api




commit 6811ae8119152250537a9c3c181aaf18f3e99f00
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 19 21:56:43 2021 -0400

    builder: Drop unused part of private api
    
    The aliases arguments was used to support 'primary',
    but we no longer have that, and all callers pass
    NULL for aliases. So, just drop it.

 gtk/gtkbuilder.c        | 21 ++++-----------------
 gtk/gtkbuilderparser.c  |  2 +-
 gtk/gtkbuilderprivate.h |  7 +++----
 3 files changed, 8 insertions(+), 22 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 697246790b..7dd93b7500 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -1971,7 +1971,7 @@ gtk_builder_value_from_string (GtkBuilder   *builder,
     {
       gunichar c;
       g_value_init (value, G_TYPE_UINT);
-      c = g_utf8_get_char_validated (string, strlen (string));
+      c = g_utf8_get_char_validated (string, -1);
       if (c != 0 && c != (gunichar)-1 && c != (gunichar)-2)
         g_value_set_uint (value, c);
       return TRUE;
@@ -2178,7 +2178,7 @@ gtk_builder_value_from_string_type (GtkBuilder   *builder,
       {
         guint flags_value;
 
-        if (!_gtk_builder_flags_from_string (type, NULL, string, &flags_value, error))
+        if (!_gtk_builder_flags_from_string (type, string, &flags_value, error))
           {
             ret = FALSE;
             break;
@@ -2543,9 +2543,9 @@ _gtk_builder_enum_from_string (GType         type,
   else
     {
       eclass = g_type_class_ref (type);
-      ev = g_enum_get_value_by_name (eclass, string);
+      ev = g_enum_get_value_by_nick (eclass, string);
       if (!ev)
-        ev = g_enum_get_value_by_nick (eclass, string);
+        ev = g_enum_get_value_by_name (eclass, string);
 
       if (ev)
         *enum_value = ev->value;
@@ -2567,7 +2567,6 @@ _gtk_builder_enum_from_string (GType         type,
 
 gboolean
 _gtk_builder_flags_from_string (GType         type,
-                                GFlagsValue  *aliases,
                                 const char   *string,
                                 guint        *flags_value,
                                 GError      **error)
@@ -2637,18 +2636,6 @@ _gtk_builder_flags_from_string (GType         type,
 
               fv = NULL;
 
-              if (aliases)
-                {
-                  for (k = 0; aliases[k].value_nick; k++)
-                    {
-                      if (g_ascii_strcasecmp (aliases[k].value_nick, flag) == 0)
-                        {
-                          fv = &aliases[k];
-                          break;
-                        }
-                    }
-                }
-
               if (!fv)
                 fv = g_flags_get_value_by_name (fclass, flag);
 
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index b9efb13fae..0e614ccdac 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -918,7 +918,7 @@ parse_property (ParserData   *data,
 
   if (bind_flags_str)
     {
-      if (!_gtk_builder_flags_from_string (G_TYPE_BINDING_FLAGS, NULL, bind_flags_str, &bind_flags, error))
+      if (!_gtk_builder_flags_from_string (G_TYPE_BINDING_FLAGS, bind_flags_str, &bind_flags, error))
         {
           _gtk_builder_prefix_error (data->builder, &data->ctx, error);
           return;
diff --git a/gtk/gtkbuilderprivate.h b/gtk/gtkbuilderprivate.h
index 36fe77c55d..913fa263a9 100644
--- a/gtk/gtkbuilderprivate.h
+++ b/gtk/gtkbuilderprivate.h
@@ -238,10 +238,9 @@ gboolean _gtk_builder_enum_from_string (GType         type,
                                         int          *enum_value,
                                         GError      **error);
 gboolean  _gtk_builder_flags_from_string (GType         type,
-                                          GFlagsValue  *aliases,
-                                         const char   *string,
-                                         guint        *value,
-                                         GError      **error);
+                                          const char   *string,
+                                          guint        *value,
+                                          GError      **error);
 gboolean _gtk_builder_boolean_from_string (const char   *string,
                                            gboolean     *value,
                                            GError      **error);


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