[rygel] core: Don't create iconList element if it exists



commit faf3962fee1c969a0b04e4c17fd38fa77963421c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Aug 25 14:30:11 2009 +0300

    core: Don't create iconList element if it exists

 src/rygel/rygel-root-device-factory.vala |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala
index f569f62..b29da43 100644
--- a/src/rygel/rygel-root-device-factory.vala
+++ b/src/rygel/rygel-root-device-factory.vala
@@ -220,9 +220,16 @@ public class Rygel.RootDeviceFactory {
             return;
         }
 
-        Xml.Node *icon_list_node = device_element->new_child (null,
-                                                              "iconList",
-                                                              null);
+        Xml.Node *icon_list_node = Utils.get_xml_element (device_element,
+                                                          "iconList",
+                                                          null);
+        if (icon_list_node == null) {
+            icon_list_node = device_element->new_child (null, "iconList", null);
+        } else {
+            // Clear the existing icon list first
+            icon_list_node->set_content ("");
+        }
+
         foreach (IconInfo icon_info in plugin.icon_infos) {
             add_icon_to_desc (icon_list_node, icon_info, plugin);
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]