core: Make @null static in Database class
authorJens Georg <mail@jensge.org>
Tue, 20 Oct 2009 17:02:12 +0000 (19:02 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sat, 24 Oct 2009 13:43:26 +0000 (16:43 +0300)
There is no need for an instance of Database to generate a null pointer

src/rygel/rygel-database.vala
src/rygel/rygel-media-db.vala

index e54270d..a53ece8 100644 (file)
@@ -119,7 +119,7 @@ internal class Rygel.Database : Object {
         this.db.exec ("ANALYZE");
     }
 
-    public GLib.Value get_null () {
+    public static GLib.Value @null () {
         GLib.Value v = GLib.Value (typeof (void *));
         v.set_pointer (null);
         return v;
index 9316629..c005a0a 100644 (file)
@@ -486,7 +486,7 @@ public class Rygel.MediaDB : Object {
                                 (item is MediaItem)
                                            ? (int) MediaDBObjectType.ITEM
                                            : (int) MediaDBObjectType.CONTAINER,
-                                item.parent == null ? this.db.get_null () :
+                                item.parent == null ? Database.null () :
                                                       item.parent.id,
                                 (int64) item.modified };
         this.db.exec (INSERT_OBJECT_STRING, values);