[rygel/wip/ruih] ruih: Style fixes for ServiceManager



commit c68d6f8decb09e2c6aa6138d39acd7387bc43c89
Author: Jens Georg <mail jensge org>
Date:   Sun Oct 19 15:51:36 2014 +0200

    ruih: Style fixes for ServiceManager
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/librygel-ruih/rygel-ruih-servicemanager.vala |   28 +++++++++++-----------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/librygel-ruih/rygel-ruih-servicemanager.vala 
b/src/librygel-ruih/rygel-ruih-servicemanager.vala
index 8c57c3e..df19ec1 100644
--- a/src/librygel-ruih/rygel-ruih-servicemanager.vala
+++ b/src/librygel-ruih/rygel-ruih-servicemanager.vala
@@ -162,7 +162,7 @@ public class Rygel.RuihServiceManager : Object
         delete doc;
 
         // Generate result XML with or without protocols
-        StringBuilder result = new StringBuilder (PRE_RESULT);
+        var result = new StringBuilder (PRE_RESULT);
 
         if (this.ui_list != null && this.ui_list.size > 0) {
             var result_content = new StringBuilder ();
@@ -183,8 +183,9 @@ public class Rygel.RuihServiceManager : Object
         return result.str;
     }
 
-    private void convert_device_profile_to_filter (Xml.Node *node,
-                                                   Gee.List<FilterEntry> filter_entries) {
+    private void convert_device_profile_to_filter
+                                        (Xml.Node *node,
+                                         Gee.List<FilterEntry> filter_entries) {
         if (node == null || node->name != DEVICEPROFILE) {
             return;
         }
@@ -235,20 +236,20 @@ public class Rygel.RuihServiceManager : Object
         } else if (!filter_is_wildcard) {
             // Check if the input UIFilter is in the right format.
             if ((filter.get_char (0) != '"') ||
-                ((filter.get_char (filter.length - 1) != '"')
-                && (filter.get_char (filter.length - 1) != ','))
-                ||  (!(filter.contains (",")) && filter.contains (";"))) {
-                throw new RuihServiceError.INVALID_FILTER
-                    ("Invalid filter: " + filter);
+                ((filter.get_char (filter.length - 1) != '"') &&
+                 (filter.get_char (filter.length - 1) != ',')) ||
+                (!(filter.contains (",")) && filter.contains (";"))) {
+                var msg = _("Invalid UI filter: %s");
+                throw new RuihServiceError.INVALID_FILTER (msg.printf (filter));
             }
 
-            string[] entries = filter.split (",");
+            var entries = filter.split (",");
             foreach (unowned string str in entries) {
                 // separator with no content, ignore
                 if (str.length == 0) {
                     continue;
                 }
-                string value = null;
+
                 // string off quotes
                 var name_value = str.split ("=");
                 if (name_value != null &&
@@ -256,10 +257,9 @@ public class Rygel.RuihServiceManager : Object
                     name_value[1] != null &&
                     name_value[1].length > 2) {
                     if (name_value[1].get_char (0) == '"' &&
-                       name_value[1].get_char
-                       (name_value[1].length - 1) == '"') {
-                        value = name_value[1].substring
-                            (1, name_value[1].length - 1);
+                        name_value[1].get_char (name_value[1].length - 1) == '"') {
+                        var value = name_value[1].substring
+                                        (1, name_value[1].length - 1);
                         filter_entries.add (new FilterEntry
                                             (name_value[0], value));
                     }


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