[tracker] tracker-miner-fs: Don't send 0 thumbnail sized queues



commit ee33fff4246d8e68ca319e11c7cec88bd9d52fbc
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Sep 29 15:40:18 2009 +0100

    tracker-miner-fs: Don't send 0 thumbnail sized queues
    
    Also print we are sending the items BEFORE we send them to make
    logging clearer when the proxy is NULL or we get some errors from the
    dbus call.

 src/tracker-miner-fs/tracker-thumbnailer.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-thumbnailer.c b/src/tracker-miner-fs/tracker-thumbnailer.c
index cd92659..674c0f5 100644
--- a/src/tracker-miner-fs/tracker-thumbnailer.c
+++ b/src/tracker-miner-fs/tracker-thumbnailer.c
@@ -378,6 +378,16 @@ tracker_thumbnailer_queue_send (void)
 	private = g_static_private_get (&private_key);
 	g_return_if_fail (private != NULL);
 
+	if (g_slist_length (private->uris) < 1) {
+		/* Nothing to do */
+		g_message ("Thumbnailer queue is empty, nothing to send to thumbnailer");
+		return;
+	}
+
+	g_message ("Thumbnailer queue sent with %d items to thumbnailer daemon, request ID:%d...", 
+		   g_slist_length (private->uris),
+		   private->request_id++);
+
 	uri_strv = tracker_dbus_slist_to_strv (private->uris);
 	mime_type_strv = tracker_dbus_slist_to_strv (private->mime_types);
 
@@ -388,10 +398,6 @@ tracker_thumbnailer_queue_send (void)
 				    G_TYPE_UINT, 0,
 				    G_TYPE_INVALID,
 				    G_TYPE_INVALID);
-
-	g_message ("Thumbnailer queue sent with %d items to thumbnailer daemon, request ID:%d...", 
-		   g_slist_length (private->uris),
-		   private->request_id);
 	
 	/* Clean up newly created GStrv */
 	g_strfreev (uri_strv);



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