[banshee] [gio] Make Gio.DemuxVfs behaviour consistent



commit 93a5f87ff25ffa4618f6ab54da40b355fe804ad2
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Fri Mar 19 12:26:29 2010 +1100

    [gio] Make Gio.DemuxVfs behaviour consistent
    
    ...with SystemIO.DemuxVfs and Unix.DemuxVfs

 .../Banshee.Gio/Banshee.IO.Gio/DemuxVfs.cs         |    5 ++---
 src/Backends/Banshee.Gio/Banshee.IO.Gio/Tests.cs   |    4 +++-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/Backends/Banshee.Gio/Banshee.IO.Gio/DemuxVfs.cs b/src/Backends/Banshee.Gio/Banshee.IO.Gio/DemuxVfs.cs
index 752c019..4a347b1 100644
--- a/src/Backends/Banshee.Gio/Banshee.IO.Gio/DemuxVfs.cs
+++ b/src/Backends/Banshee.Gio/Banshee.IO.Gio/DemuxVfs.cs
@@ -40,9 +40,8 @@ namespace Banshee.IO.Gio
         public DemuxVfs (string path)
         {
             file = path.StartsWith ("/") ? FileFactory.NewForPath (path) : FileFactory.NewForUri (path);
-            var f = file.Exists ? file : file.Parent;
-            if (f.Exists) {
-                using (var info = f.QueryInfo ("etag::value,access::can-read,access::can-write", FileQueryInfoFlags.None, null)) {
+            if (file.Exists) {
+                using (var info = file.QueryInfo ("etag::value,access::can-read,access::can-write", FileQueryInfoFlags.None, null)) {
                     IsReadable = info.GetAttributeBoolean ("access::can-read");
                     IsWritable = info.GetAttributeBoolean ("access::can-write");
                 }
diff --git a/src/Backends/Banshee.Gio/Banshee.IO.Gio/Tests.cs b/src/Backends/Banshee.Gio/Banshee.IO.Gio/Tests.cs
index 4345640..283c695 100644
--- a/src/Backends/Banshee.Gio/Banshee.IO.Gio/Tests.cs
+++ b/src/Backends/Banshee.Gio/Banshee.IO.Gio/Tests.cs
@@ -136,7 +136,9 @@ namespace Banshee.IO.Gio
         {
             var newf = Uri ("newfile");
             var newp = Path ("newfile");
-            Assert.IsFalse (file.Exists (newf));
+
+            file.OpenWrite (newf, false).Close ();
+            Assert.IsTrue (file.Exists (newf));
 
             var demux = new DemuxVfs (newp);
             Assert.IsTrue (demux.IsWritable);



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