[glade3] * gladeui/glade-builtins.c: Fixed redundant registering of displayable values for stock items.



commit 841de951597828915715eaee8fcac40910168504
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat Jan 8 17:45:33 2011 +0900

    	* gladeui/glade-builtins.c: Fixed redundant registering of displayable values for
    	stock items.

 ChangeLog                |    3 +++
 gladeui/glade-builtins.c |   18 ++++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7f3ca8f..53dc59a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
 	from glade-utils, selection can only be placed on widgets and only be controlled
 	by their owning project.
 
+	* gladeui/glade-builtins.c: Fixed redundant registering of displayable values for
+	stock items.
+
 2011-01-07  Emilio Pozuelo Monfort <pochu27 gmail com>
 
 	* configure.ac: Bump the minimum GTK+ version to 2.99.0.
diff --git a/gladeui/glade-builtins.c b/gladeui/glade-builtins.c
index 48a5a2b..ad96b47 100644
--- a/gladeui/glade-builtins.c
+++ b/gladeui/glade-builtins.c
@@ -276,8 +276,9 @@ glade_standard_stock_get_type (void)
           if (gtk_stock_lookup (enum_values[i].value_nick, &item))
             {
               gchar *clean_name = clean_stock_name (item.label);
-              glade_register_translated_value (etype, enum_values[i].value_nick,
-                                               clean_name);
+
+	      if (!glade_get_displayable_value (etype, enum_values[i].value_nick))
+		glade_register_translated_value (etype, enum_values[i].value_nick, clean_name);
               g_free (clean_name);
             }
         }
@@ -310,8 +311,8 @@ glade_standard_stock_image_get_type (void)
               gchar *clean_name = clean_stock_name (item.label);
 
               /* These are translated, we just cut out the mnemonic underscores */
-              glade_register_translated_value (etype, enum_values[i].value_nick,
-                                               clean_name);
+	      if (!glade_get_displayable_value (etype, enum_values[i].value_nick))
+		glade_register_translated_value (etype, enum_values[i].value_nick, clean_name);
               g_free (clean_name);
             }
         }
@@ -319,10 +320,11 @@ glade_standard_stock_image_get_type (void)
       for (i = 0; i < G_N_ELEMENTS (builtin_stock_images); i++)
         {
           /* these ones are translated from glade3 */
-          glade_register_displayable_value (etype,
-                                            builtin_stock_images[i],
-                                            GETTEXT_PACKAGE,
-                                            builtin_stock_displayables[i]);
+	  if (!glade_get_displayable_value (etype, builtin_stock_images[i]))
+	    glade_register_displayable_value (etype,
+					      builtin_stock_images[i],
+					      GETTEXT_PACKAGE,
+					      builtin_stock_displayables[i]);
         }
     }
   return etype;



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