[f-spot] Fix --view mode with multiple argument
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot] Fix --view mode with multiple argument
- Date: Mon, 4 Jan 2010 12:22:43 +0000 (UTC)
commit 3917ba08e0501d659ba90d83dc1a004574141df4
Author: Stephane Delcroix <stephane delcroix org>
Date: Mon Jan 4 13:22:21 2010 +0100
Fix --view mode with multiple argument
This was broken at the time we did the libunique transition. This, btw, is the first Linq usage in f-spot
src/Core/App.cs | 18 +++++++++++++++---
src/main.cs | 2 +-
2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/App.cs b/src/Core/App.cs
index b572a81..4c847da 100644
--- a/src/Core/App.cs
+++ b/src/Core/App.cs
@@ -12,6 +12,7 @@
using System;
using System.IO;
using System.Collections.Generic;
+using System.Linq;
using Unique;
@@ -103,20 +104,31 @@ namespace FSpot
HandleSlideshow (tagname);
}
+ public void View (Uri uri)
+ {
+ View (new Uri[] {uri});
+ }
+
+ public void View (IEnumerable<Uri> uris)
+ {
+ var uri_s = from uri in uris select uri.ToString ();
+ View (uri_s);
+ }
+
public void View (string uri)
{
View (new string[] {uri});
}
- public void View (string[] uris)
+ public void View (IEnumerable<string> uris)
{
if (IsRunning) {
var md = new MessageData ();
- md.Uris = uris;
+ md.Uris = uris.ToArray ();
SendMessage (Command.View, md);
return;
}
- HandleView (uris);
+ HandleView (uris.ToArray());
}
#endregion
diff --git a/src/main.cs b/src/main.cs
index f21d1f1..2b02ede 100644
--- a/src/main.cs
+++ b/src/main.cs
@@ -232,7 +232,7 @@ namespace FSpot
Help ();
return 1;
}
- App.Instance.View (list.ToString ());
+ App.Instance.View (list);
} else if (import_uri != null) {
App.Instance.Import (import_uri);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]