~ubuntu-branches/ubuntu/raring/banshee/raring

« back to all changes in this revision

Viewing changes to src/Backends/Banshee.Gio/Banshee.IO.Gio/Directory.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-08-24 02:25:28 UTC
  • mfrom: (1.15.10) (6.4.26 sid)
  • mto: This revision was merged to the branch mainline in revision 143.
  • Revision ID: package-import@ubuntu.com-20120824022528-17uu5u9yfheko50h
Tags: 2.5.0-1
* [2fb3583] Imported Upstream version 2.5.0
* [40793f9] Refresh patches and drop upstreamed Fix-FTBFS….patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            return (type & FileType.Directory) != 0;
109
109
        }
110
110
 
111
 
        public IEnumerable<string> GetFiles (string directory)
 
111
        public IEnumerable<SafeUri> GetFiles (string directory)
112
112
        {
113
113
            return GetFiles (GetDir (directory), true);
114
114
        }
115
115
 
116
 
        private IEnumerable<string> GetFiles (GLib.File dir, bool followSymlinks)
 
116
        private IEnumerable<SafeUri> GetFiles (GLib.File dir, bool followSymlinks)
117
117
        {
118
118
            var enumerator = dir.EnumerateChildren ("standard::type,standard::name", followSymlinks ? FileQueryInfoFlags.None : FileQueryInfoFlags.NofollowSymlinks, null);
119
119
            foreach (FileInfo file in enumerator) {
120
120
                if ((file.FileType & FileType.Regular) != 0) {
121
 
                    var ret = SafeUri.FilenameToUri (System.IO.Path.Combine (dir.Path, file.Name));
 
121
                    var ret = new SafeUri (System.IO.Path.Combine (dir.Path, file.Name), false);
122
122
                    file.Dispose ();
123
123
                    yield return ret;
124
124
                } else {
131
131
            }
132
132
        }
133
133
 
134
 
        public IEnumerable<string> GetDirectories (string directory)
 
134
        public IEnumerable<SafeUri> GetDirectories (string directory)
135
135
        {
136
136
            return GetDirectories (GetDir (directory), true);
137
137
        }
138
138
 
139
 
        private IEnumerable<string> GetDirectories (GLib.File dir, bool followSymlinks)
 
139
        private IEnumerable<SafeUri> GetDirectories (GLib.File dir, bool followSymlinks)
140
140
        {
141
141
            var enumerator = dir.EnumerateChildren ("standard::type,standard::name", followSymlinks ? FileQueryInfoFlags.None : FileQueryInfoFlags.NofollowSymlinks, null);
142
142
            foreach (FileInfo file in enumerator) {
143
143
                if ((file.FileType & FileType.Directory) != 0) {
144
 
                    var ret = SafeUri.FilenameToUri (System.IO.Path.Combine (dir.Path, file.Name));
 
144
                    var ret = new SafeUri (System.IO.Path.Combine (dir.Path, file.Name), false);
145
145
                    file.Dispose ();
146
146
                    yield return ret;
147
147
                } else {