[rygel] core: Refactor SourceConnectionManager.constructed



commit fe0ebf757349075d334eceb4a8d49fa25cf7a2c4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Apr 13 15:05:47 2011 +0300

    core: Refactor SourceConnectionManager.constructed

 src/rygel/rygel-source-connection-manager.vala |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/rygel/rygel-source-connection-manager.vala b/src/rygel/rygel-source-connection-manager.vala
index 2e83b6f..d2805f2 100644
--- a/src/rygel/rygel-source-connection-manager.vala
+++ b/src/rygel/rygel-source-connection-manager.vala
@@ -23,6 +23,7 @@
 
 using GUPnP;
 using Gst;
+using Gee;
 
 /**
  * UPnP ConnectionManager service for serving end-points (MediaServer).
@@ -35,6 +36,17 @@ internal class Rygel.SourceConnectionManager : Rygel.ConnectionManager {
         this.av_transport_id = -1;
         this.direction = "Output";
 
+        foreach (var protocol_info in this.get_protocol_info ()) {
+            if (this.source_protocol_info != "") {
+                // No comma before the first one
+                this.source_protocol_info += ",";
+            }
+
+            this.source_protocol_info += protocol_info.to_string ();
+        }
+    }
+
+    public ArrayList<ProtocolInfo> get_protocol_info () {
         var server = this.get_http_server ();
         var protocol_infos = server.get_protocol_info ();
 
@@ -55,14 +67,7 @@ internal class Rygel.SourceConnectionManager : Rygel.ConnectionManager {
             }
         }
 
-        foreach (var protocol_info in protocol_infos) {
-            if (this.source_protocol_info != "") {
-                // No comma before the first one
-                this.source_protocol_info += ",";
-            }
-
-            this.source_protocol_info += protocol_info.to_string ();
-        }
+        return protocol_infos;
     }
 
     private HTTPServer get_http_server () {



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