rygel r106 - in trunk: . src



Author: zeeshanak
Date: Tue Oct 28 21:00:27 2008
New Revision: 106
URL: http://svn.gnome.org/viewvc/rygel?rev=106&view=rev

Log:
Use 'this' keyword wherever possible. This makes code much more cleaner.

Modified:
   trunk/ChangeLog
   trunk/src/gupnp-metadata-extractor.vala

Modified: trunk/src/gupnp-metadata-extractor.vala
==============================================================================
--- trunk/src/gupnp-metadata-extractor.vala	(original)
+++ trunk/src/gupnp-metadata-extractor.vala	Tue Oct 28 21:00:27 2008
@@ -38,15 +38,15 @@
 
     public string uri {
         get {
-            return playbin.uri;
+            return this.playbin.uri;
         }
 
         set {
-            playbin.uri = value;
+            this.playbin.uri = value;
 
-            if (playbin.uri != null) {
+            if (this.playbin.uri != null) {
                 /* Start the extaction when we get a new URI */
-                playbin.set_state (State.PAUSED);
+                this.playbin.set_state (State.PAUSED);
             }
         }
     }
@@ -55,32 +55,32 @@
     public List <string> _uris = null;
     public List <string> uris {
         get {
-            return _uris;
+            return this._uris;
         }
 
         set {
-            _uris = value.copy ();
+            this._uris = value.copy ();
 
-            if (_uris != null) {
-                extraction_done += goto_next_uri;
-                uri = _uris.data;
+            if (this._uris != null) {
+                this.extraction_done += this.goto_next_uri;
+                this.uri = this._uris.data;
             } else {
-                extraction_done -= goto_next_uri;
+                this.extraction_done -= this.goto_next_uri;
             }
         }
     }
 
     private void goto_next_uri (MetadataExtractor extractor,
                                 string            uri) {
-        return_if_fail (_uris != null);
+        return_if_fail (this._uris != null);
 
-        weak List <string> link = _uris.find_custom (uri, strcmp);
-        _uris.remove_link (link);
+        weak List <string> link = this._uris.find_custom (uri, strcmp);
+        this._uris.remove_link (link);
 
-        if (_uris != null) {
-            this.uri = _uris.data;
+        if (this._uris != null) {
+            this.uri = this._uris.data;
         } else {
-            extraction_done -= goto_next_uri;
+            this.extraction_done -= this.goto_next_uri;
         }
     }
 
@@ -90,7 +90,7 @@
 
         message.parse_tag (out tag_list);
 
-        tag_list.foreach (foreach_tag);
+        tag_list.foreach (this.foreach_tag);
     }
 
     private void foreach_tag (TagList tag_list, string tag) {
@@ -98,13 +98,13 @@
 
         if (tag_list.copy_value (ref value, tag_list, tag)) {
             /* signal the availability of new tag */
-            metadata_available (playbin.uri, tag, ref value);
+            this.metadata_available (this.playbin.uri, tag, ref value);
         }
     }
 
     private void state_changed_cb (Gst.Bus     bus,
                                    Gst.Message message) {
-        if (message.src != playbin)
+        if (message.src != this.playbin)
             return;
 
         State new_state;
@@ -114,28 +114,28 @@
             int64 duration;
 
             Format format = Format.TIME;
-            if (playbin.query_duration (ref format, out duration)) {
+            if (this.playbin.query_duration (ref format, out duration)) {
                 GLib.Value duration_val;
 
                 duration_val.init (typeof (int64));
                 duration_val.set_int64 (duration);
 
                 /* signal the availability of duration tag */
-                metadata_available (playbin.uri,
+                this.metadata_available (this.playbin.uri,
                                     TAG_DURATION,
                                     ref duration_val);
             }
 
             /* No hopes of getting any tags after this point */
-            playbin.set_state (State.NULL);
-            extraction_done (playbin.uri);
+            this.playbin.set_state (State.NULL);
+            this.extraction_done (this.playbin.uri);
         }
     }
 
     private void error_cb (Gst.Bus     bus,
                            Gst.Message message) {
 
-        return_if_fail (uri != null);
+        return_if_fail (this.uri != null);
 
         Error error = null;
         string debug;
@@ -145,24 +145,24 @@
             debug = error.message;
         }
 
-        critical ("Failed to extract metadata from %s: %s\n", uri, debug);
+        critical ("Failed to extract metadata from %s: %s\n", this.uri, debug);
 
-        if (_uris != null) {
+        if (this._uris != null) {
             /* We have a list of URIs to harvest, so lets jump to next one */
-            goto_next_uri (this, uri);
+            this.goto_next_uri (this, this.uri);
         }
     }
 
     construct {
-        playbin = ElementFactory.make ("playbin", null);
+        this.playbin = ElementFactory.make ("playbin", null);
 
-        var bus = playbin.get_bus ();
+        var bus = this.playbin.get_bus ();
 
         bus.add_signal_watch ();
 
-        bus.message["tag"] += tag_cb;
-        bus.message["state-changed"] += state_changed_cb;
-        bus.message["error"] += error_cb;
+        bus.message["tag"] += this.tag_cb;
+        bus.message["state-changed"] += this.state_changed_cb;
+        bus.message["error"] += this.error_cb;
     }
 }
 



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