[rygel/config] UDN is supposted to be a constant



commit bae74634f3615abb990422ae66ffef2c1077a860
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Apr 24 15:47:35 2009 +0300

    UDN is supposted to be a constant
    
    Only generate the UDN if it's not already done and save it once it's
    generated.
---
 src/rygel/rygel-configuration.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/rygel/rygel-configuration.vala b/src/rygel/rygel-configuration.vala
index 69c94f3..fd01199 100644
--- a/src/rygel/rygel-configuration.vala
+++ b/src/rygel/rygel-configuration.vala
@@ -64,9 +64,14 @@ public class Rygel.Configuration {
     }
 
     public string get_udn (string section) {
-        var new_udn = Utils.generate_random_udn ();
+        var udn = this.get_string (section, UDN_KEY, null);
+        if (udn == null) {
+            udn = Utils.generate_random_udn ();
 
-        return this.get_string (section, UDN_KEY, new_udn);
+            this.set_string (section, UDN_KEY, udn);
+        }
+
+        return udn;
     }
 
     public string? get_string (string  section,



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