summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <jp@synctv.com>2009-04-24 21:56:04 -0300
committerJuan Pablo Ugarte <jp@synctv.com>2009-04-24 21:56:04 -0300
commitf86b49b362600f7f885e63519ad733904facd3c3 (patch)
tree24dd04a4d32df85ec7b99af72a28c238f3ec25fd
parentfc99cccb081108e1f29b15ef99bc4eefd749896a (diff)
downloadglade-f86b49b362600f7f885e63519ad733904facd3c3.tar.gz
* plugins/gtk+/glade-gtk.c:
o fixed icon source state write bug on write_icon_sources() o fixed loading bug in glade_gtk_icon_factory_read_sources() we either use g_list_append() or steal/insert to add new icon sources
-rw-r--r--ChangeLog7
-rw-r--r--plugins/gtk+/glade-gtk.c21
2 files changed, 26 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ab5f334..3e682473 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-24 Juan Pablo Ugarte <juanpablougarte@gmail.com>
+
+ * plugins/gtk+/glade-gtk.c:
+ o fixed icon source state write bug on write_icon_sources()
+ o fixed loading bug in glade_gtk_icon_factory_read_sources()
+ we either use g_list_append() or steal/insert to add new icon sources
+
2009-04-22 Tristan Van Berkom <tvb@gnome.org>
* NEWS, configure.ac: Rolling 3.6.3
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index b7ca6c63..d45edfa3 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -9382,7 +9382,24 @@ glade_gtk_icon_factory_read_sources (GladeWidget *widget,
}
if ((list = g_hash_table_lookup (sources->sources, g_strdup (current_icon_name))) != NULL)
- list = g_list_prepend (list, source);
+ {
+ GList *new_list = g_list_append (list, source);
+
+ /* Warning: if we use g_list_prepend() the returned pointer will be different
+ * so we would have to replace the list pointer in the hash table.
+ * But before doing that we have to steal the old list pointer otherwise
+ * we would have to make a copy then add the new icon to finally replace the hash table
+ * value.
+ * Anyways if we choose to prepend we would have to reverse the list outside this loop
+ * so its better to append.
+ */
+ if (new_list != list)
+ {
+ /* current g_list_append() returns the same pointer so this is not needed */
+ g_hash_table_steal (sources->sources, current_icon_name);
+ g_hash_table_insert (sources->sources, g_strdup (current_icon_name), new_list);
+ }
+ }
else
{
list = g_list_append (NULL, source);
@@ -9455,7 +9472,7 @@ write_icon_sources (gchar *icon_name,
if (!gtk_icon_source_get_state_wildcarded (source))
{
- GtkStateType state = gtk_icon_source_get_size (source);
+ GtkStateType state = gtk_icon_source_get_state (source);
string = glade_utils_enum_string_from_value (GTK_TYPE_STATE_TYPE, state);
glade_xml_node_set_property_string (source_node, GLADE_TAG_STATE, string);
g_free (string);