[gtk+] gtk-builder-tool: Always emit translatable properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk-builder-tool: Always emit translatable properties
- Date: Sat, 2 May 2015 21:39:24 +0000 (UTC)
commit 932e2546888e53726f5553106512c77cc13424e9
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 2 13:15:18 2015 -0400
gtk-builder-tool: Always emit translatable properties
Seems unlikely that these would ever have a default value,
but better safe than sorry.
gtk/gtk-builder-tool.c | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c
index 5c1a3ec..9825190 100644
--- a/gtk/gtk-builder-tool.c
+++ b/gtk/gtk-builder-tool.c
@@ -166,19 +166,31 @@ maybe_emit_property (MyParserData *data)
gchar *escaped;
gint i;
gboolean bound;
+ gboolean translatable;
+ bound = FALSE;
+ translatable = FALSE;
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)
- break;
+ if (strcmp (data->attribute_names[i], "name") == 0)
+ {
+ if (data->classes == NULL)
+ break;
- if (needs_explicit_setting (data, i))
- break;
+ if (needs_explicit_setting (data, i))
+ break;
- if (value_is_default (data, i))
- return;
+ if (value_is_default (data, i))
+ return;
+ }
}
}
@@ -196,14 +208,12 @@ maybe_emit_property (MyParserData *data)
{
if (!data->cell_packing_started)
{
- g_print ("%*s<packing>\n", data->indent, "");
+ g_print ("%*s<cell-packing>\n", data->indent, "");
data->indent += 2;
data->cell_packing_started = TRUE;
}
}
- bound = FALSE;
-
g_print ("%*s<property", data->indent, "");
for (i = 0; data->attribute_names[i]; i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]