Remove leaky hack to assign unowned strings to weak fields.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Thu, 25 Dec 2008 12:01:26 +0000 (12:01 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Thu, 25 Dec 2008 12:01:26 +0000 (12:01 +0000)
The fields are no longer 'weak' so unowned strings can simply be assigned
to them and vala will take care of them for us.

svn path=/trunk/; revision=387

src/plugins/dvb/rygel-dvb-channel.vala
src/plugins/test/rygel-test-item.vala
src/plugins/tracker/rygel-tracker-image-item.vala
src/plugins/tracker/rygel-tracker-music-item.vala
src/plugins/tracker/rygel-tracker-video-item.vala
src/rygel/rygel-media-item.vala

index 4877355..5ece2c7 100644 (file)
@@ -64,10 +64,7 @@ public class Rygel.DVBChannel : MediaItem {
         }
 
         this.res.mime_type = "video/mpeg";
-        // FIXME: (Leaky) Hack to assign the string to weak fields
-        string uri = this.channel_list.GetChannelURL (cid);
-        string *uri_ptr = #uri;
-        this.res.uri = uri_ptr;
+        this.res.uri = this.channel_list.GetChannelURL (cid);
     }
 }
 
index 5080e59..f0cdb21 100644 (file)
@@ -45,14 +45,11 @@ public abstract class Rygel.TestItem : Rygel.MediaItem {
                      string   path) {
         base (id, parent_id, title, upnp_class, streamer);
 
-        // FIXME: (Leaky) Hack to assign the string to weak fields
-        string *mime_type = mime;
-        this.res.mime_type = mime_type;
+        this.res.mime_type = mime;
         this.author = TEST_AUTHOR;
         this.path= path;
 
-        string *uri = streamer.create_uri_for_path (path);
-        this.res.uri = uri;
+        this.res.uri = streamer.create_uri_for_path (path);
 
         streamer.stream_available += this.on_stream_available;
     }
index ee8c0ff..b4931b7 100644 (file)
@@ -100,13 +100,10 @@ public class Rygel.TrackerImageItem : TrackerItem {
             this.date = seconds_to_iso8601 (values[Metadata.IMAGE_DATE]);
         }
 
-        // FIXME: (Leaky) Hack to assign the string to weak fields
-        string *mime = #values[Metadata.MIME];
-        this.res.mime_type = mime;
+        this.res.mime_type = values[Metadata.MIME];
         this.author = values[Metadata.CREATOR];
         this.album = values[Metadata.ALBUM];
-        string *uri = this.uri_from_path (path);
-        this.res.uri = uri;
+        this.res.uri = this.uri_from_path (path);
     }
 }
 
index b68e2b6..4f3cc24 100644 (file)
@@ -96,13 +96,10 @@ public class Rygel.TrackerMusicItem : TrackerItem {
             this.date = seconds_to_iso8601 (values[Metadata.DATE_ADDED]);
         }
 
-        // FIXME: (Leaky) Hack to assign the string to weak fields
-        string *mime = #values[Metadata.MIME];
-        this.res.mime_type = mime;
+        this.res.mime_type = values[Metadata.MIME];
         this.author = values[Metadata.ARTIST];
         this.album = values[Metadata.ALBUM];
-        string *uri = this.uri_from_path (path);
-        this.res.uri = uri;
+        this.res.uri = this.uri_from_path (path);
     }
 }
 
index eed79b3..f787747 100644 (file)
@@ -88,12 +88,9 @@ public class Rygel.TrackerVideoItem : TrackerItem {
             this.res.height = values[Metadata.HEIGHT].to_int ();
 
         this.date = this.seconds_to_iso8601 (values[Metadata.DATE]);
-        // FIXME: (Leaky) Hack to assign the string to weak fields
-        string *mime = #values[Metadata.MIME];
-        this.res.mime_type = mime;
+        this.res.mime_type = values[Metadata.MIME];
         this.author = values[Metadata.AUTHOR];
-        string *uri = this.uri_from_path (path);
-        this.res.uri = uri;
+        this.res.uri = this.uri_from_path (path);
     }
 }
 
index b44cb20..37ba67c 100644 (file)
@@ -170,8 +170,7 @@ public class Rygel.MediaItem : MediaObject {
         DIDLLiteResource res = orig_res;
 
         // Then modify the URI and protocol
-        string *uri = this.streamer.create_http_uri_for_item (this);
-        res.uri = uri;
+        res.uri = this.streamer.create_http_uri_for_item (this);
         res.protocol = "http-get";
 
         resources.append (res);