[ease/flickr] Delimit search terms with commas.



commit 4d7d700d8203dcc3b01b652a594871bb944dc6fb
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Thu Jun 17 03:58:30 2010 +0200

    Delimit search terms with commas.
    
    Need to make sure that Flickr tags doesn't allow spaces,
    otherwise this is pretty useless.

 plugins/flickr.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flickr.vala b/plugins/flickr.vala
index 00aa3fd..d6f5f3b 100644
--- a/plugins/flickr.vala
+++ b/plugins/flickr.vala
@@ -26,7 +26,7 @@ public class FlickrFetcher {
 
 	private Gdk.Pixbuf? gdk_pixbug_from_uri (string uri) {
 
-		File file = File.new_for_uri (uri);
+		var file = File.new_for_uri (uri);
 		FileInputStream filestream;
 		try {
 			filestream = file.read (null);
@@ -123,7 +123,10 @@ public class FlickrFetcher {
 	[CCode (instance_pos = -1)]
 	public void on_search_button (Button? b) {
 		
-		string tags = this.search_entry.get_text ();
+		string entry = this.search_entry.get_text ();
+		// convert spaces to comas
+		string tags = entry.delimit (" ", ',');
+		search_entry.set_text (tags);
 
 		string answer = get_flickr_photos_from_tags (tags);
 		parse_flickr_photos (answer);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]