[rygel] tracker: Make use of default value magic in Vala



commit 5d8b23bbac6337fbd24ce5aa3f2753889f7e98a7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Sep 21 01:49:48 2009 +0300

    tracker: Make use of default value magic in Vala
    
    Use default value for query_condition param of SearchContainer
    construction method.

 .../tracker/rygel-tracker-root-container.vala      |    9 +++------
 .../tracker/rygel-tracker-search-container.vala    |    9 ++-------
 2 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-root-container.vala b/src/plugins/tracker/rygel-tracker-root-container.vala
index 612364b..c520118 100644
--- a/src/plugins/tracker/rygel-tracker-root-container.vala
+++ b/src/plugins/tracker/rygel-tracker-root-container.vala
@@ -37,20 +37,17 @@ public class Rygel.TrackerRootContainer : Rygel.SimpleContainer {
                                         "16",
                                         this,
                                         "Pictures",
-                                        TrackerImageItem.SERVICE,
-                                        null));
+                                        TrackerImageItem.SERVICE));
         this.children.add (new TrackerSearchContainer (
                                         "14",
                                         this,
                                         "Music",
-                                        TrackerMusicItem.SERVICE,
-                                        null));
+                                        TrackerMusicItem.SERVICE));
         this.children.add (new TrackerSearchContainer (
                                         "15",
                                         this,
                                         "Videos",
-                                        TrackerVideoItem.SERVICE,
-                                        null));
+                                        TrackerVideoItem.SERVICE));
         this.children.add (new TrackerMetadataValues ("Audio:Artist",
                                                       "17",
                                                       this,
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index d0cf1fd..f56bb50 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -54,18 +54,13 @@ public class Rygel.TrackerSearchContainer : Rygel.MediaContainer {
                                    MediaContainer parent,
                                    string         title,
                                    string         service,
-                                   string?        query_condition,
+                                   string         query_condition = "",
                                    string[]       keywords = new string[0]) {
         base (id, parent, title, 0);
 
         this.service = service;
         this.keywords = keywords;
-
-        if (query_condition != null) {
-            this.query_condition = query_condition;
-        } else {
-            this.query_condition = "";
-        }
+        this.query_condition = query_condition;
 
         try {
             this.create_proxies ();



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