muine r1240 - in trunk: . src
- From: plaes svn gnome org
- To: svn-commits-list gnome org
- Subject: muine r1240 - in trunk: . src
- Date: Mon, 10 Nov 2008 10:00:26 +0000 (UTC)
Author: plaes
Date: Mon Nov 10 10:00:26 2008
New Revision: 1240
URL: http://svn.gnome.org/viewvc/muine?rev=1240&view=rev
Log:
2008-11-10 Priit Laes <plaes svn gnome org>
Bug 560115 â [PATCH] Use Gnome.Vfs#
* TODO:
* src/FileUtils.cs:
* src/CoverImage.cs:
* src/FileSelector.cs:
* src/AddSongWindow.cs:
* src/PlaylistWindow.cs:
* src/AddAlbumWindow.cs:
Drop P/Invoked gnome-vfs functions. Use Gnome.Vfs# API directly.
2008-11-10 Priit Laes <plaes svn gnome org>
Bug 474090 â Switch to taglib-sharp
* src/Metadata.cs: Add cover reading for Apple MPEG4 files.
Modified:
trunk/ChangeLog
trunk/TODO
trunk/src/AddAlbumWindow.cs
trunk/src/AddSongWindow.cs
trunk/src/CoverImage.cs
trunk/src/FileSelector.cs
trunk/src/FileUtils.cs
trunk/src/Metadata.cs
trunk/src/PlaylistWindow.cs
Modified: trunk/TODO
==============================================================================
--- trunk/TODO (original)
+++ trunk/TODO Mon Nov 10 10:00:26 2008
@@ -1,9 +1,6 @@
Easy:
=====
-o Use GnomeVFS
- Needs a new Mono release first
-
o A song information dialog (Jorn is on this)
See http://huizen.dds.nl/~jbaayen/infodialog-proposal.html
o Fill in the gaps in the API docs
Modified: trunk/src/AddAlbumWindow.cs
==============================================================================
--- trunk/src/AddAlbumWindow.cs (original)
+++ trunk/src/AddAlbumWindow.cs Mon Nov 10 10:00:26 2008
@@ -21,6 +21,8 @@
using System.Collections;
using Mono.Unix;
+using Gnome.Vfs;
+
namespace Muine
{
public class AddAlbumWindow : AddWindow
@@ -215,7 +217,7 @@
Album album = GetAlbum (album_ptr_i);
foreach (Song song in album.Songs) {
- string uri = FileUtils.UriFromLocalPath (song.Filename);
+ string uri = Gnome.Vfs.Uri.GetUriFromLocalPath (song.Filename);
data += (uri + "\r\n");
}
}
Modified: trunk/src/AddSongWindow.cs
==============================================================================
--- trunk/src/AddSongWindow.cs (original)
+++ trunk/src/AddSongWindow.cs Mon Nov 10 10:00:26 2008
@@ -21,6 +21,8 @@
using System.Collections;
using Mono.Unix;
+using Gnome.Vfs;
+
namespace Muine
{
public class AddSongWindow : AddWindow
@@ -162,7 +164,7 @@
foreach (int song_ptr_i in songs) {
Song song = GetSong (song_ptr_i);
- string uri = FileUtils.UriFromLocalPath (song.Filename);
+ string uri = Gnome.Vfs.Uri.GetUriFromLocalPath (song.Filename);
data += (uri + "\r\n");
}
Modified: trunk/src/CoverImage.cs
==============================================================================
--- trunk/src/CoverImage.cs (original)
+++ trunk/src/CoverImage.cs Mon Nov 10 10:00:26 2008
@@ -94,7 +94,7 @@
case (uint) DndUtils.TargetType.UriList:
uri_list = DndUtils.SplitSelectionData (data);
- fn = FileUtils.LocalPathFromUri (uri_list [0]);
+ fn = Gnome.Vfs.Uri.GetLocalPathFromUri (uri_list [0]);
if (fn == null)
break;
Modified: trunk/src/FileSelector.cs
==============================================================================
--- trunk/src/FileSelector.cs (original)
+++ trunk/src/FileSelector.cs Mon Nov 10 10:00:26 2008
@@ -75,7 +75,7 @@
(string) Config.Get (gconf_path, GConfDefaultStartDir);
start_dir = start_dir.Replace ("~",
- FileUtils.UriFromLocalPath (FileUtils.HomeDirectory));
+ Gnome.Vfs.Uri.GetUriFromLocalPath (FileUtils.HomeDirectory));
SetCurrentFolderUri (start_dir);
Modified: trunk/src/FileUtils.cs
==============================================================================
--- trunk/src/FileUtils.cs (original)
+++ trunk/src/FileUtils.cs Mon Nov 10 10:00:26 2008
@@ -366,66 +366,6 @@
dinfo.Create ();
}
- // Methods :: Public :: LocalPathFromUri
- // TODO:
- // * Replace with GnomeVfs#
- // * Can this be replaced or simplified with
- // System.Uri.LocalPath?
- [DllImport ("libgnomevfs-2-0.dll")]
- private static extern IntPtr gnome_vfs_get_local_path_from_uri
- (string str);
-
- /// <summary>
- /// Convert a URI to a local pathname.
- /// </summary>
- /// <returns>
- /// A pathname.
- /// </returns>
- public static string LocalPathFromUri (string uri)
- {
- IntPtr p = gnome_vfs_get_local_path_from_uri (uri);
-
- string path;
- if (p == IntPtr.Zero)
- path = null;
- else
- path = GLib.Marshaller.PtrToStringGFree (p);
-
- return path;
- }
-
- // Methods :: Public :: UriFromLocalPath
- // TODO:
- // * Replace with GnomeVfs#
- // * Can this be replaced or simplified with
- // System.Uri.ToString?
- [DllImport ("libgnomevfs-2-0.dll")]
- private static extern IntPtr gnome_vfs_get_uri_from_local_path
- (string str);
-
- /// <summary>
- /// Convert a local pathname to a URI.
- /// </summary>
- /// <remarks>
- /// The local pathname should begin with '/'.
- /// The returned URI will begin with "file://".
- /// </remarks>
- /// <returns>
- /// A URI.
- /// </returns>
- public static string UriFromLocalPath (string path)
- {
- IntPtr uri_ptr = gnome_vfs_get_uri_from_local_path (path);
-
- string uri;
- if (uri_ptr == IntPtr.Zero)
- uri = null;
- else
- uri = GLib.Marshaller.PtrToStringGFree (uri_ptr);
-
- return uri;
- }
-
// Methods :: Public ::: IsRemote
// TODO:
// * Make portable
Modified: trunk/src/Metadata.cs
==============================================================================
--- trunk/src/Metadata.cs (original)
+++ trunk/src/Metadata.cs Mon Nov 10 10:00:26 2008
@@ -96,14 +96,11 @@
return album_art;
}
}
-
- /*
- FIXME!!! API changes...
TagLib.Mpeg4.AppleTag apple_tag = (TagLib.Mpeg4.AppleTag) file.GetTag (TagTypes.Apple);
if (apple_tag != null) {
foreach (AppleDataBox b in apple_tag.DataBoxes ("covr")) {
- if (b.Flags == (uint) AppleDataBox.FlagTypes.ContainsJpegData ||
- b.Flags == (uint) AppleDataBox.FlagTypes.ContainsPngData) {
+ if (b.Flags == (uint) AppleDataBox.FlagType.ContainsJpegData ||
+ b.Flags == (uint) AppleDataBox.FlagType.ContainsPngData) {
album_art = GetPixbuf (b.Data);
if (album_art != null)
@@ -111,7 +108,6 @@
}
}
}
- */
}
return album_art;
}
Modified: trunk/src/PlaylistWindow.cs
==============================================================================
--- trunk/src/PlaylistWindow.cs (original)
+++ trunk/src/PlaylistWindow.cs Mon Nov 10 10:00:26 2008
@@ -1915,7 +1915,7 @@
IntPtr s = new IntPtr (p);
Song song = Song.FromHandle (s);
- string uri = FileUtils.UriFromLocalPath (song.Filename);
+ string uri = Gnome.Vfs.Uri.GetUriFromLocalPath (song.Filename);
files += (uri + "\r\n");
}
@@ -2088,7 +2088,7 @@
ArrayList new_dinfos = new ArrayList ();
foreach (string s in bits) {
- string fn = FileUtils.LocalPathFromUri (s);
+ string fn = Gnome.Vfs.Uri.GetLocalPathFromUri (s);
if (fn == null)
continue;
@@ -2193,7 +2193,7 @@
SavePlaylist (file, false, false);
- string uri = FileUtils.UriFromLocalPath (file);
+ string uri = Gnome.Vfs.Uri.GetUriFromLocalPath (file);
string target = DndUtils.TargetUriList.Target;
Gdk.Atom atom = Gdk.Atom.Intern (target, false);
@@ -2222,7 +2222,7 @@
bool success = false;
foreach (string s in bits) {
- string fn = FileUtils.LocalPathFromUri (s);
+ string fn = Gnome.Vfs.Uri.GetLocalPathFromUri (s);
if (fn == null)
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]