gtk-builder-tool: Always emit translatable properties

Seems unlikely that these would ever have a default value,
but better safe than sorry.
This commit is contained in:
Matthias Clasen 2015-05-02 13:15:18 -04:00
parent 060c4f9c66
commit 932e254688

View File

@ -166,19 +166,31 @@ maybe_emit_property (MyParserData *data)
gchar *escaped; gchar *escaped;
gint i; gint i;
gboolean bound; gboolean bound;
gboolean translatable;
bound = FALSE;
translatable = FALSE;
for (i = 0; data->attribute_names[i]; i++) for (i = 0; data->attribute_names[i]; i++)
{ {
if (strcmp (data->attribute_names[i], "name") == 0) if (strcmp (data->attribute_names[i], "translatable") == 0)
translatable = TRUE;
}
if (!translatable)
{
for (i = 0; data->attribute_names[i]; i++)
{ {
if (data->classes == NULL) if (strcmp (data->attribute_names[i], "name") == 0)
break; {
if (data->classes == NULL)
break;
if (needs_explicit_setting (data, i)) if (needs_explicit_setting (data, i))
break; break;
if (value_is_default (data, i)) if (value_is_default (data, i))
return; return;
}
} }
} }
@ -196,14 +208,12 @@ maybe_emit_property (MyParserData *data)
{ {
if (!data->cell_packing_started) if (!data->cell_packing_started)
{ {
g_print ("%*s<packing>\n", data->indent, ""); g_print ("%*s<cell-packing>\n", data->indent, "");
data->indent += 2; data->indent += 2;
data->cell_packing_started = TRUE; data->cell_packing_started = TRUE;
} }
} }
bound = FALSE;
g_print ("%*s<property", data->indent, ""); g_print ("%*s<property", data->indent, "");
for (i = 0; data->attribute_names[i]; i++) for (i = 0; data->attribute_names[i]; i++)
{ {