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



commit efb090b50ddd9fd41df35e5c3d9b863f6a29719d
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       |    6 ++++++
 src/librygel-server/rygel-writable-container.vala |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index 6b3953a..b93ddc6 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -265,6 +265,12 @@ 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 (file.get_uri_scheme () == WritableContainer.WRITABLE_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]