[rygel] media-export plugin: Remove the D-Bus service.



commit 9b9d4e47a752f8a8012c9caca0da38d837e83c2a
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 17 11:40:25 2013 +0100

    media-export plugin: Remove the D-Bus service.
    
    This /org/gnome/Rygel/MediaExport1 D-Bus service allowed adding
    and removing and discovery of URIs that are indexed, but nothing
    uses it and nothing needs to use it. GNOME Control Center instead
    edits the rygel.conf file, to do the same thing.

 src/librygel-server/rygel-media-container.vala     |    3 +
 src/librygel-server/rygel-media-object.vala        |   10 ++++
 src/plugins/media-export/Makefile.am               |    1 -
 .../rygel-media-export-dbus-service.vala           |   54 --------------------
 .../rygel-media-export-root-container.vala         |   43 ----------------
 5 files changed, 13 insertions(+), 98 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-container.vala b/src/librygel-server/rygel-media-container.vala
index 23b997a..ffa1828 100644
--- a/src/librygel-server/rygel-media-container.vala
+++ b/src/librygel-server/rygel-media-container.vala
@@ -40,6 +40,9 @@ public enum Rygel.ObjectEventType {
  *
  * A derived class should provide a working implementation of get_children
  * and should emit the container_updated signal.
+ *
+ * When used as a root container, you may wish to use the variables, such as
+ * REALNAME, in in the title. See the title property of the #RygelMediaObject.
  */
 public abstract class Rygel.MediaContainer : MediaObject {
     public const string UPNP_CLASS = "object.container";
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index dc4f0b9..af5eafb 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -71,6 +71,16 @@ public abstract class Rygel.MediaObject : GLib.Object {
     }
 
     private string _title;
+
+    /**
+     * The human-readable title of this container or item.
+     * These variables will be substituted:
+     *
+     * - @REALNAME@< ill be subsituted by the user's real name.
+     * - @USERNAME@ will be substituted by the users's login ID.
+     * - @HOSTNAME@ will be substituted by the name of the machine.
+     * - @ADDRESS@ will be substited by the 
+     */
     public string title {
         get {
             return _title;
diff --git a/src/plugins/media-export/Makefile.am b/src/plugins/media-export/Makefile.am
index 41584d7..b59010e 100644
--- a/src/plugins/media-export/Makefile.am
+++ b/src/plugins/media-export/Makefile.am
@@ -21,7 +21,6 @@ librygel_media_export_la_SOURCES = \
 	rygel-media-export-query-container-factory.vala \
 	rygel-media-export-node-query-container.vala \
 	rygel-media-export-leaf-query-container.vala \
-	rygel-media-export-dbus-service.vala \
 	rygel-media-export-recursive-file-monitor.vala \
 	rygel-media-export-harvester.vala \
 	rygel-media-export-harvesting-task.vala \
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 9f76a40..89b73f4 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -41,7 +41,6 @@ const Rygel.MediaExport.FolderDefinition[] VIRTUAL_FOLDERS_MUSIC = {
  * Represents the root container.
  */
 public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
-    private DBusService    service;
     private Harvester      harvester;
     private Cancellable    cancellable;
     private MediaContainer filesystem_container;
@@ -84,37 +83,6 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
         this.cancellable.cancel ();
     }
 
-    // DBus utility methods
-
-    public void add_uri (string uri) {
-        var file = File.new_for_commandline_arg (uri);
-        this.harvester.schedule (file,
-                                 this.filesystem_container,
-                                 "DBUS");
-    }
-
-    public void remove_uri (string uri) {
-        var file = File.new_for_commandline_arg (uri);
-        var id = MediaCache.get_id (file);
-
-        this.harvester.cancel (file);
-        try {
-            this.media_db.remove_by_id (id);
-        } catch (Error error) {
-            warning (_("Failed to remove URI: %s"), error.message);
-        }
-    }
-
-    public string[] get_dynamic_uris () {
-        try {
-            var uris = this.media_db.get_flagged_uris ("DBUS");
-
-            return uris.to_array ();
-        } catch (Error error) { }
-
-        return new string[0];
-    }
-
     // MediaContainer overrides
 
     public override async MediaObject? find_object (string       id,
@@ -204,10 +172,6 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
             uris = new ArrayList<string> ();
         }
 
-        try {
-            uris.add_all (this.media_db.get_flagged_uris ("DBUS"));
-        } catch (Error error) {}
-
         actual_uris = new ArrayList<File> ();
 
         var home_dir = File.new_for_path (Environment.get_home_dir ());
@@ -377,13 +341,6 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
         this.cancellable = new Cancellable ();
 
         try {
-            this.service = new DBusService (this);
-        } catch (Error err) {
-            warning (_("Failed to create MediaExport D-Bus service: %s"),
-                     err.message);
-        }
-
-        try {
             this.media_db.save_container (this);
         } catch (Error error) { } // do nothing
 



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