summaryrefslogtreecommitdiff
path: root/gladeui
diff options
context:
space:
mode:
authorVincent Geddes <vgeddes@src.gnome.org>2007-07-02 21:34:07 +0000
committerVincent Geddes <vgeddes@src.gnome.org>2007-07-02 21:34:07 +0000
commita24af636e4fc2cd10e28e600ffef6ae3eb739a75 (patch)
treed2b564894d766f1b7dd59c500664244a3ba24bfa /gladeui
parent20454a9f8c3fb4b390420828709b4022f1563b6e (diff)
downloadglade-a24af636e4fc2cd10e28e600ffef6ae3eb739a75.tar.gz
Properly handle dgettext() operations (#453105, Christian Persch).
* gladeui/glade-catalog.c, gladeui/glade-widget-adaptor.c: Properly handle dgettext() operations (#453105, Christian Persch). * gladeui/glade-binding.c (glade_binding_load_all): Close GDir when finished reading. svn path=/trunk/; revision=1425
Diffstat (limited to 'gladeui')
-rw-r--r--gladeui/glade-binding.c2
-rw-r--r--gladeui/glade-widget-adaptor.c34
2 files changed, 25 insertions, 11 deletions
diff --git a/gladeui/glade-binding.c b/gladeui/glade-binding.c
index 3d0ee48f..686da949 100644
--- a/gladeui/glade-binding.c
+++ b/gladeui/glade-binding.c
@@ -101,6 +101,8 @@ glade_binding_load_all (void)
g_hash_table_insert (bindings, binding->ctrl.name, binding);
g_free (path);
}
+
+ g_dir_close (dir);
}
static void
diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c
index 5246f129..27e43c42 100644
--- a/gladeui/glade-widget-adaptor.c
+++ b/gladeui/glade-widget-adaptor.c
@@ -1474,6 +1474,7 @@ glade_widget_adaptor_from_catalog (GladeXmlNode *class_node,
{
GladeWidgetAdaptor *adaptor = NULL;
gchar *name, *generic_name, *icon_name, *adaptor_icon_name, *adaptor_name, *func_name;
+ gchar *title, *translated_title;
GType object_type, adaptor_type, parent_type;
GWADerivedClassData data;
@@ -1552,21 +1553,32 @@ glade_widget_adaptor_from_catalog (GladeXmlNode *class_node,
g_free (generic_name);
g_free (icon_name);
g_free (adaptor_icon_name);
-
- if ((adaptor->title = glade_xml_get_property_string_required
- (class_node, GLADE_TAG_TITLE,
- "This value is needed to display object class names in the UI")) == NULL)
+
+
+ title = glade_xml_get_property_string_required (class_node,
+ GLADE_TAG_TITLE,
+ "This value is needed to "
+ "display object class names "
+ "in the UI");
+ if (title == NULL)
{
- g_warning ("Class '%s' built without a '%s'", name, GLADE_TAG_TITLE);
+ g_warning ("Class '%s' declared without a '%s' attribute", name, GLADE_TAG_TITLE);
adaptor->title = g_strdup (name);
}
-
- /* Translate title */
- if (adaptor->title != dgettext (domain, adaptor->title))
+ else
{
- gchar *ptr = dgettext (domain, adaptor->title);
- g_free (adaptor->title);
- adaptor->title = ptr;
+ /* translate */
+ translated_title = dgettext (domain, title);
+ if (translated_title != title)
+ {
+ /* gettext owns translated_title */
+ adaptor->title = g_strdup (translated_title);
+ g_free (title);
+ }
+ else
+ {
+ adaptor->title = title;
+ }
}
if (G_TYPE_IS_INSTANTIATABLE (adaptor->type) &&