[banshee] Playlists: replace some path operation with Normalize methods from Hyena
- From: AndrÃs Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Playlists: replace some path operation with Normalize methods from Hyena
- Date: Sun, 11 Nov 2012 21:47:50 +0000 (UTC)
commit 6baab7c4f4252dc332d85334ca8bf13b343de633
Author: Andres G. Aragoneses <knocte gmail com>
Date: Sun Nov 11 21:23:08 2012 +0000
Playlists: replace some path operation with Normalize methods from Hyena
For readability, these separator replacing operations have been moved to
Hyena, where other path operations already exist (such as MakeRelative()).
.../Banshee.Playlists.Formats/M3uPlaylistFormat.cs | 6 +++---
.../PlaylistFormatBase.cs | 5 ++---
2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Playlists.Formats/M3uPlaylistFormat.cs b/src/Core/Banshee.Services/Banshee.Playlists.Formats/M3uPlaylistFormat.cs
index 031bbb9..82b66eb 100644
--- a/src/Core/Banshee.Services/Banshee.Playlists.Formats/M3uPlaylistFormat.cs
+++ b/src/Core/Banshee.Services/Banshee.Playlists.Formats/M3uPlaylistFormat.cs
@@ -35,7 +35,7 @@ using Mono.Unix;
using Banshee.Base;
using Banshee.Collection;
using Banshee.Sources;
-using Folder = Banshee.IO.Directory;
+using Hyena;
namespace Banshee.Playlists.Formats
{
@@ -124,8 +124,8 @@ namespace Banshee.Playlists.Formats
writer.WriteLine("#EXTINF:{0},{1} - {2}", duration, track.DisplayArtistName, track.DisplayTrackTitle);
string trackpath = ExportUri (track.Uri);
- if (FolderSeparator == Folder.DosSeparator) {
- trackpath = trackpath.Replace (Folder.UnixSeparator, Folder.DosSeparator);
+ if (FolderSeparator == Paths.Folder.DosSeparator) {
+ trackpath = Paths.NormalizeToDos (trackpath);
}
writer.WriteLine( trackpath );
}
diff --git a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistFormatBase.cs b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistFormatBase.cs
index 2889100..8061323 100644
--- a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistFormatBase.cs
+++ b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistFormatBase.cs
@@ -79,9 +79,8 @@ namespace Banshee.Playlists.Formats
protected virtual Uri ResolveUri(string uri)
{
- if (!uri.Contains (Folder.UnixSeparator.ToString ()) && uri.Contains (Folder.DosSeparator.ToString ())) {
- uri = uri.Replace (Folder.DosSeparator, Folder.UnixSeparator);
- }
+ uri = Paths.NormalizeToUnix (uri);
+
return BaseUri == null ? new Uri(uri) : new Uri(BaseUri, uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]