[rygel/wip/create-reference: 5/6] server: Add support non-fs-based WritableContainer



commit dfae554f80a8f1a5cd71a478e99bc393caf7f1f8
Author: Jens Georg <jensg openismus com>
Date:   Fri Apr 12 12:56:12 2013 +0200

    server: Add support non-fs-based WritableContainer

 src/librygel-server/rygel-media-object.vala       |    7 +++++++
 src/librygel-server/rygel-writable-container.vala |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index 6b3953a..3d6c0a4 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -265,6 +265,13 @@ public abstract class Rygel.MediaObject : GLib.Object {
 
     private async bool check_writable (File file, Cancellable? cancellable)
                                        throws Error {
+        // Special URI scheme to indicate that this is a writable container
+        // but doesn't have any real filesystem backing
+        if (WritableContainer.WRITABLE_SCHEME.has_prefix
+                                        (file.get_uri_scheme())) {
+            return true;
+        }
+
         if (!file.is_native ()) {
             return false;
         }
diff --git a/src/librygel-server/rygel-writable-container.vala 
b/src/librygel-server/rygel-writable-container.vala
index 44bd609..f293f9d 100644
--- a/src/librygel-server/rygel-writable-container.vala
+++ b/src/librygel-server/rygel-writable-container.vala
@@ -41,6 +41,8 @@ public errordomain Rygel.WritableContainerError {
  *  # Monitor not only its own URI but also that of its child items, though the latter is implied in the 
former if you use GIO for monitoring.
  */
 public interface Rygel.WritableContainer : MediaContainer {
+    public static const string WRITABLE_SCHEME = "rygel-writable://";
+
     //TODO: The valadoc gtk-doc doclet doesn't use the property's documentation
     //on getters and setters:
     //https://bugzilla.gnome.org/show_bug.cgi?id=684193


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