[rygel] tracker: Default id & filter funcs shouldn't be static



commit a3be5d7861c1609accba87f064a99eb3a226893d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Aug 11 20:11:26 2010 +0300

    tracker: Default id & filter funcs shouldn't be static

 .../tracker/rygel-tracker-metadata-values.vala     |   22 +++++++++++++++----
 1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-metadata-values.vala b/src/plugins/tracker/rygel-tracker-metadata-values.vala
index 2c319e9..b4ac9d7 100644
--- a/src/plugins/tracker/rygel-tracker-metadata-values.vala
+++ b/src/plugins/tracker/rygel-tracker-metadata-values.vala
@@ -55,9 +55,9 @@ public class Rygel.Tracker.MetadataValues : Rygel.SimpleContainer {
                            string         title,
                            ItemFactory    item_factory,
                            string[]       key_chain,
-                           IDFunc?        id_func = default_id_func,
-                           IDFunc?        title_func = default_id_func,
-                           FilterFunc?    filter_func = default_filter_func) {
+                           IDFunc?        id_func = null,
+                           IDFunc?        title_func = null,
+                           FilterFunc?    filter_func = null) {
         base (id, parent, title);
 
         this.item_factory = item_factory;
@@ -66,6 +66,18 @@ public class Rygel.Tracker.MetadataValues : Rygel.SimpleContainer {
         this.title_func = title_func;
         this.filter_func = filter_func;
 
+        if (id_func == null) {
+            this.id_func = this.default_id_func;
+        }
+
+        if (title_func == null) {
+            this.title_func = this.default_id_func;
+        }
+
+        if (filter_func == null) {
+            this.filter_func = this.default_filter_func;
+        }
+
         try {
             this.create_proxies ();
         } catch (DBus.Error error) {
@@ -166,11 +178,11 @@ public class Rygel.Tracker.MetadataValues : Rygel.SimpleContainer {
         this.updated ();
     }
 
-    public static string default_id_func (string value) {
+    public string default_id_func (string value) {
         return value;
     }
 
-    public static string default_filter_func (string variable, string value) {
+    public string default_filter_func (string variable, string value) {
         return variable + " = \"" + value + "\"";
     }
 



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