[rygel] all: Adapt to upcoming changes in Vala 0.14



commit 5f00fc40bb7b94d2109286d93efd913e06bedbd1
Author: Jens Georg <mail jensge org>
Date:   Sat Jul 16 13:39:01 2011 +0200

    all: Adapt to upcoming changes in Vala 0.14

 .../external/rygel-external-plugin-factory.vala    |   14 +++++++-------
 .../media-export/rygel-media-export-harvester.vala |    2 +-
 .../rygel-media-export-media-cache.vala            |   12 ++++++------
 .../rygel-media-export-root-container.vala         |    2 ++
 .../rygel-mediathek-video-item-factory.vala        |    1 +
 src/plugins/mpris/rygel-mpris-plugin-factory.vala  |   12 ++++++------
 .../tracker/rygel-tracker-search-container.vala    |    2 ++
 src/rygel/rygel-plugin-loader.vala                 |    2 +-
 src/ui/rygel-writable-user-config.vala             |   18 ++++++++++--------
 9 files changed, 36 insertions(+), 29 deletions(-)
---
diff --git a/src/plugins/external/rygel-external-plugin-factory.vala b/src/plugins/external/rygel-external-plugin-factory.vala
index cceb77d..8864754 100644
--- a/src/plugins/external/rygel-external-plugin-factory.vala
+++ b/src/plugins/external/rygel-external-plugin-factory.vala
@@ -41,9 +41,9 @@ public class Rygel.External.PluginFactory {
     private const string SERVICE_PREFIX = "org.gnome.UPnP.MediaServer2.";
     private const string GRILO_UPNP_PREFIX = SERVICE_PREFIX + "grl_upnp";
 
-    DBusObject   dbus_obj;
-    PluginLoader loader;
-    IconFactory  icon_factory;
+    FreeDesktop.DBusObject dbus_obj;
+    PluginLoader           loader;
+    IconFactory            icon_factory;
 
     public PluginFactory (PluginLoader loader) throws IOError, DBusError {
         this.icon_factory = new IconFactory ();
@@ -84,10 +84,10 @@ public class Rygel.External.PluginFactory {
         this.dbus_obj.name_owner_changed.connect (this.name_owner_changed);
     }
 
-    private void name_owner_changed (DBusObject dbus_obj,
-                                     string     name,
-                                     string     old_owner,
-                                     string     new_owner) {
+    private void name_owner_changed (FreeDesktop.DBusObject dbus_obj,
+                                     string                 name,
+                                     string                 old_owner,
+                                     string                 new_owner) {
         var plugin = this.loader.get_plugin_by_name (name);
 
         if (plugin != null) {
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index 3ca5386..b86cd2a 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -250,7 +250,7 @@ internal class Rygel.MediaExport.Harvester : GLib.Object {
         };
 
         var timeout = Timeout.add_seconds (FILE_CHANGE_DEFAULT_GRACE_PERIOD,
-                                           callback);
+                                           (owned) callback);
         this.extraction_grace_timers[file] = timeout;
     }
 }
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 1d1dea8..f0572c6 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -343,6 +343,7 @@ public class Rygel.MediaExport.MediaCache : Object {
         Database.RowCallback callback = (statement) => {
             var child_id = statement.column_text (DetailColumn.ID);
             var parent_id = statement.column_text (DetailColumn.PARENT);
+
             if (parent == null || parent_id != parent.id) {
                 parent = new NullContainer ();
                 parent.id = parent_id;
@@ -751,13 +752,12 @@ public class Rygel.MediaExport.MediaCache : Object {
                 throw new MediaCacheError.UNSUPPORTED_SEARCH (message);
         }
 
-        if (&collate != null) {
-            if (use_collation) {
-                collate = "COLLATE CASEFOLD";
-            } else {
-                collate = "";
-            }
+        if (use_collation) {
+            collate = "COLLATE CASEFOLD";
+        } else {
+            collate = "";
         }
+
         return column;
     }
 
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index c5b9efc..b2c80e5 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -282,6 +282,8 @@ public class Rygel.MediaExport.RootContainer : Rygel.MediaExport.DBContainer {
         RelationalExpression virtual_expression = null;
         QueryContainer query_container;
 
+        container = null;
+
         if (!(expression is LogicalExpression)) {
             return false;
         }
diff --git a/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala b/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
index 88d6ab6..5c89a64 100644
--- a/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
+++ b/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
@@ -105,6 +105,7 @@ internal class Rygel.Mediathek.VideoItemFactory : Object {
                                         throws VideoItemError {
         var title_node = XMLUtils.get_element (item, "title");
         var group = XMLUtils.get_element (item, "group");
+        playlist_url = null;
 
         if (title_node == null) {
             throw new VideoItemError.XML_PARSE_ERROR ("No 'title' element");
diff --git a/src/plugins/mpris/rygel-mpris-plugin-factory.vala b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
index 2a9ad6c..3c0a5a3 100644
--- a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
@@ -44,8 +44,8 @@ public class Rygel.MPRIS.PluginFactory {
     private const string SERVICE_PREFIX = "org.mpris.MediaPlayer2.";
     private const string MEDIA_PLAYER_PATH = "/org/mpris/MediaPlayer2";
 
-    DBusObject   dbus_obj;
-    PluginLoader loader;
+    FreeDesktop.DBusObject dbus_obj;
+    PluginLoader           loader;
 
     public PluginFactory (PluginLoader loader) throws IOError {
         this.dbus_obj = Bus.get_proxy_sync
@@ -84,10 +84,10 @@ public class Rygel.MPRIS.PluginFactory {
         this.dbus_obj.name_owner_changed.connect (this.name_owner_changed);
     }
 
-    private void name_owner_changed (DBusObject dbus_obj,
-                                     string     name,
-                                     string     old_owner,
-                                     string     new_owner) {
+    private void name_owner_changed (FreeDesktop.DBusObject dbus_obj,
+                                     string                 name,
+                                     string                 old_owner,
+                                     string                 new_owner) {
         var plugin = this.loader.get_plugin_by_name (name);
 
         if (plugin != null) {
diff --git a/src/plugins/tracker/rygel-tracker-search-container.vala b/src/plugins/tracker/rygel-tracker-search-container.vala
index 7c6c086..9017fe8 100644
--- a/src/plugins/tracker/rygel-tracker-search-container.vala
+++ b/src/plugins/tracker/rygel-tracker-search-container.vala
@@ -182,6 +182,8 @@ public class Rygel.Tracker.SearchContainer : SimpleContainer {
 
             return tokens[1];
         } else {
+            parent_id = null;
+
             return null;
         }
     }
diff --git a/src/rygel/rygel-plugin-loader.vala b/src/rygel/rygel-plugin-loader.vala
index 68eaf2f..293f566 100644
--- a/src/rygel/rygel-plugin-loader.vala
+++ b/src/rygel/rygel-plugin-loader.vala
@@ -164,7 +164,7 @@ public class Rygel.PluginLoader : Object {
             return;
         }
 
-        ModuleInitFunc module_init = (ModuleInitFunc) function;
+        unowned ModuleInitFunc module_init = (ModuleInitFunc) function;
         assert (module_init != null);
 
         // We don't want our modules to ever unload
diff --git a/src/ui/rygel-writable-user-config.vala b/src/ui/rygel-writable-user-config.vala
index 1e5483a..85be54f 100644
--- a/src/ui/rygel-writable-user-config.vala
+++ b/src/ui/rygel-writable-user-config.vala
@@ -22,8 +22,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-using FreeDesktop;
-
 /**
  * Manages the user configuration for Rygel.
  */
@@ -157,13 +155,17 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig {
             var dest = File.new_for_path (dest_path);
 
             if (enable) {
+                // TODO: Use null in watch_name once vala situation in jhbuild
+                // is cleared and vala dependency is bumped.
+                BusNameAppearedCallback a = null;
+                BusNameVanishedCallback b = null;
+
                 // Creating the proxy starts the service
-                DBusObject dbus = Bus.get_proxy_sync
-                                        (BusType.SESSION,
-                                         DBUS_SERVICE,
-                                         DBUS_OBJECT,
-                                         DBusProxyFlags.DO_NOT_LOAD_PROPERTIES);
-                dbus.start_service_by_name (DBusInterface.SERVICE_NAME, 0);
+                Bus.watch_name (BusType.SESSION,
+                                DBusInterface.SERVICE_NAME,
+                                BusNameWatcherFlags.AUTO_START,
+                                a,
+                                b);
 
                 // Then symlink the desktop file to user's autostart dir
                 var source_path = Path.build_filename (BuildConfig.DESKTOP_DIR,



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