Remove unwanted whitespace from test URLs
authorMatthew Vogt <matthew.vogt@nokia.com>
Tue, 10 Jul 2012 05:01:19 +0000 (15:01 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 10 Jul 2012 05:15:49 +0000 (07:15 +0200)
Change-Id: Ia39c7bc458f46a8a32c1e54a8963b1f89dbbf271
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
tests/auto/qml/qqmlxmlhttprequest/data/stateChangeCallingContext.qml

index 1f679d8..f44f4f9 100644 (file)
@@ -29,8 +29,12 @@ Item {
                 var components = xhr.responseText.split('\n');
                 var i;
                 for (i=0; i<components.length; i++) {
-                    if (components[i].split(";").length == 2) {
-                        componentlist.append({"Name" : components[i].split(";")[0], "url" : components[i].split(";")[1]})
+                    var pair = components[i].split(";")
+                    if (pair.length == 2) {
+                        // Trim any unwanted whitespace
+                        var name = pair[0].replace(/^\s+|\s+$/g, "")
+                        var url = pair[1].replace(/^\s+|\s+$/g, "")
+                        componentlist.append({"Name" : name, "url" : url})
                     }
                 }
             }