[rygel] core: Clean-up & indent recently added code
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Clean-up & indent recently added code
- Date: Mon, 28 Dec 2009 16:14:31 +0000 (UTC)
commit ff4f961ba5f5fc455da54d7cd00cb06bab62bfc8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Mon Dec 28 18:07:28 2009 +0200
core: Clean-up & indent recently added code
src/rygel/rygel-http-item-uri.vala | 49 +++++++++++++++++++----------------
1 files changed, 27 insertions(+), 22 deletions(-)
---
diff --git a/src/rygel/rygel-http-item-uri.vala b/src/rygel/rygel-http-item-uri.vala
index 245e22f..268001c 100644
--- a/src/rygel/rygel-http-item-uri.vala
+++ b/src/rygel/rygel-http-item-uri.vala
@@ -39,29 +39,34 @@ internal class Rygel.HTTPItemURI : Object {
this.transcode_target = null;
var request_uri = uri.replace (server_root, "");
var parts = request_uri.split ("/");
- if (parts.length < 2 || parts.length % 2 == 0)
+
+ if (parts.length < 2 || parts.length % 2 == 0) {
warning ("Invalid uri %s", request_uri);
- else {
- for (int i = 1; i < parts.length - 1; i += 2) {
- switch (parts[i]) {
- case "item":
- StringBuilder sb = new StringBuilder ();
- size_t len;
- var data = Base64.decode (
- Soup.URI.decode (parts[i + 1]),
- out len);
- sb.append_len ((string) data, (ssize_t) len);
- this.item_id = sb.str;
- break;
- case "transcoded":
- this.transcode_target = Soup.URI.decode (parts[i + 1]);
- break;
- case "thumbnail":
- this.thumbnail_index = parts[i + 1].to_int ();
- break;
- default:
- break;
- }
+
+ return;
+ }
+
+ for (int i = 1; i < parts.length - 1; i += 2) {
+ switch (parts[i]) {
+ case "item":
+ size_t len;
+ var data = Base64.decode (Soup.URI.decode (parts[i + 1]),
+ out len);
+ StringBuilder builder = new StringBuilder ();
+ builder.append_len ((string) data, (ssize_t) len);
+ this.item_id = builder.str;
+
+ break;
+ case "transcoded":
+ this.transcode_target = Soup.URI.decode (parts[i + 1]);
+
+ break;
+ case "thumbnail":
+ this.thumbnail_index = parts[i + 1].to_int ();
+
+ break;
+ default:
+ break;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]