diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-10-03 09:29:45 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-10-03 09:29:45 -0400 |
commit | 80226ca926c9986dc91686f5682d98f6fc84c748 (patch) | |
tree | dd85c5a3b61f8a7ef80b81e0dfd5e65fae866924 /gtk/gtkbuilder.c | |
parent | b22919220b9183bdd00ec58768a82fb28d1ea716 (diff) | |
download | gtk+-80226ca926c9986dc91686f5682d98f6fc84c748.tar.gz |
GtkBuilder: Undo the type name heuristic changes
These turned out to break existing ui files, concretely
GWeatherLocationEntry was no longer guessed correctly.
Update the testcases to reflect this, and add a testcase
for GWeather.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 320c3e6ffa..fbae0317e5 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -372,23 +372,24 @@ gtk_builder_get_property (GObject *object, * GtkWindow -> gtk_window_get_type * GtkHBox -> gtk_hbox_get_type * GtkUIManager -> gtk_ui_manager_get_type - * GdkRGB -> gdk_rgb_get_type + * GWeatherLocation -> gweather_location_get_type + * + * Keep in sync with testsuite/gtk/typename.c ! */ static gchar * type_name_mangle (const gchar *name) { GString *symbol_name = g_string_new (""); - int i; + gint i; for (i = 0; name[i] != '\0'; i++) { /* skip if uppercase, first or previous is uppercase */ - if ((i > 0 && name[i] == g_ascii_toupper (name[i]) && - (name[i-1] != g_ascii_toupper (name[i-1]) || i == 1)) || - (i > 2 && name[i] == g_ascii_toupper (name[i]) && - name[i-1] == g_ascii_toupper (name[i-1]) && - name[i-2] == g_ascii_toupper (name[i-2]) && - name[i+1] != 0 && name[i+1] != g_ascii_toupper (name[i+1]))) + if ((name[i] == g_ascii_toupper (name[i]) && + i > 0 && name[i-1] != g_ascii_toupper (name[i-1])) || + (i > 2 && name[i] == g_ascii_toupper (name[i]) && + name[i-1] == g_ascii_toupper (name[i-1]) && + name[i-2] == g_ascii_toupper (name[i-2]))) g_string_append_c (symbol_name, '_'); g_string_append_c (symbol_name, g_ascii_tolower (name[i])); } |