core: Move get_writable method to MediaObject
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 1 Feb 2010 14:55:57 +0000 (16:55 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Wed, 3 Feb 2010 13:38:48 +0000 (15:38 +0200)
Move get_writable method from MediaContainer to MediaObject.

src/rygel/rygel-media-container.vala
src/rygel/rygel-media-object.vala

index 0dd0677..9cbff1e 100644 (file)
@@ -277,27 +277,5 @@ public abstract class Rygel.MediaContainer : MediaObject {
             this.parent.container_updated (updated_container);
         }
     }
-
-    /**
-     * Fetches a File object for any writable URI available for this container.
-     *
-     * @param cancellable A GLib.Cancellable
-     */
-    private async File? get_writable (Cancellable? cancellable) throws Error {
-        foreach (var uri in this.uris) {
-            var file = File.new_for_uri (uri);
-
-            var info = yield file.query_info_async (
-                                        FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
-                                        FileQueryInfoFlags.NONE,
-                                        Priority.DEFAULT,
-                                        cancellable);
-            if (info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
-                return file;
-            }
-        }
-
-        return null;
-    }
 }
 
index e142022..01c5881 100644 (file)
@@ -62,4 +62,26 @@ public abstract class Rygel.MediaObject : GLib.Object {
     construct {
         uris = new ArrayList<string> ();
     }
+
+    /**
+     * Fetches a File object for any writable URI available for this object.
+     *
+     * @param cancellable A GLib.Cancellable
+     */
+    public async File? get_writable (Cancellable? cancellable) throws Error {
+        foreach (var uri in this.uris) {
+            var file = File.new_for_uri (uri);
+
+            var info = yield file.query_info_async (
+                                        FILE_ATTRIBUTE_ACCESS_CAN_WRITE,
+                                        FileQueryInfoFlags.NONE,
+                                        Priority.DEFAULT,
+                                        cancellable);
+            if (info.get_attribute_boolean (FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
+                return file;
+            }
+        }
+
+        return null;
+    }
 }