[f-spot] drop Gnome from MW
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] drop Gnome from MW
- Date: Thu, 25 Jun 2009 11:38:12 +0000 (UTC)
commit 3b17c879c66d8f5fb783796f306c377e47fb5391
Author: Stephane Delcroix <stephane delcroix org>
Date: Thu Jun 25 13:34:29 2009 +0200
drop Gnome from MW
simply drop a Gnome.Vfs call and replace another one by a Gio equiv.
src/MainWindow.cs | 17 ++++++-----------
src/Widgets/OpenWithMenu.cs | 4 ++--
2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index d58f2ac..c12f452 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -631,11 +631,6 @@ public class MainWindow {
bool prev = valid && photo_view.View.Item.Index > 0;
bool next = valid && photo_view.View.Item.Index < query.Count - 1;
- if (valid) {
- Gnome.Vfs.Uri vfs = new Gnome.Vfs.Uri (photo_view.View.Item.Current.DefaultVersionUri.ToString ());
- valid = vfs.Scheme == "file";
- }
-
display_previous_button.Sensitive = prev;
display_next_button.Sensitive = next;
@@ -3095,18 +3090,18 @@ public class MainWindow {
}
}
- public string [] SelectedMimeTypes ()
+ public List<string> SelectedMimeTypes ()
{
- ArrayList mimes = new ArrayList ();
+ List<string> contents = new List<string> ();
foreach (Photo p in SelectedPhotos ()) {
- string mime = Gnome.Vfs.MimeType.GetMimeTypeForUri (p.DefaultVersionUri.ToString ());
+ string content = GLib.FileFactory.NewForUri (p.DefaultVersionUri).QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
- if (! mimes.Contains (mime))
- mimes.Add (mime);
+ if (! contents.Contains (content))
+ contents.Add (content);
}
- return mimes.ToArray (typeof (string)) as string [];
+ return contents;
}
private void ShowQueryWidget ()
diff --git a/src/Widgets/OpenWithMenu.cs b/src/Widgets/OpenWithMenu.cs
index 67d9b07..ad31871 100644
--- a/src/Widgets/OpenWithMenu.cs
+++ b/src/Widgets/OpenWithMenu.cs
@@ -26,7 +26,7 @@ namespace FSpot.Widgets {
public class OpenWithMenu: Gtk.Menu {
public event EventHandler<ApplicationActivatedEventArgs> ApplicationActivated;
- public delegate string [] TypeFetcher ();
+ public delegate IEnumerable<string> TypeFetcher ();
TypeFetcher type_fetcher;
List<string> ignore_apps;
@@ -76,7 +76,7 @@ namespace FSpot.Widgets {
ShowAll ();
}
- AppInfo[] ApplicationsFor (string [] types)
+ AppInfo[] ApplicationsFor (IEnumerable<string> types)
{
List<AppInfo> app_infos = new List<AppInfo> ();
List<string> existing_ids = new List<string> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]