[tracker/miner-gdata] tracker-miner-gdata: Send progress/status information



commit ca16e435bd7febe4f9331963099de87795af2b80
Author: Adrien Bustany <abustany gnome org>
Date:   Mon Mar 22 13:04:11 2010 -0300

    tracker-miner-gdata: Send progress/status information

 .../tracker-miner-picasaweb.vala                   |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-miner-gdata/tracker-miner-picasaweb.vala b/src/tracker-miner-gdata/tracker-miner-picasaweb.vala
index 585433e..19e6378 100644
--- a/src/tracker-miner-gdata/tracker-miner-picasaweb.vala
+++ b/src/tracker-miner-gdata/tracker-miner-picasaweb.vala
@@ -33,6 +33,8 @@ public class MinerPicasaweb : Tracker.MinerWeb {
 	construct {
 		set ("name", MINER_NAME);
 		set ("associated", false);
+		set ("status", "Idle");
+		set ("progress", 0.0);
 
 		service = new GData.PicasaWebService (API_KEY);
 
@@ -63,6 +65,8 @@ public class MinerPicasaweb : Tracker.MinerWeb {
 	}
 
 	private bool pull_timeout_cb () {
+		set ("status", "Refresing data");
+		set ("progress", 0.0);
 		service.query_all_albums_async (null, service.get_username (), null, albums_cb, pull_finished_cb);
 		return true;
 	}
@@ -83,6 +87,8 @@ public class MinerPicasaweb : Tracker.MinerWeb {
 			return;
 		}
 
+		set ("status", "Refreshing album \"%s\"".printf (album.get_title ()));
+
 		album_files_urls = new List<string> ();
 
 		foreach (GData.Entry current_entry in feed_files.get_entries ()) {
@@ -198,10 +204,14 @@ public class MinerPicasaweb : Tracker.MinerWeb {
 		builder.insert_close ();
 
 		query_queue.append (builder.get_result ());
+
+		set ("progress", (1.0 + entry_key)/entry_count);
 	}
 
 	private void pull_finished_cb () {
 		query_queue.flush ();
+		set ("status", "Idle");
+		set ("progress", 1.0);
 	}
 
 	public void shutdown () {



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