[tracker/tracker-0.8] libtracker-miner: Added some comments to the content guessing code()



commit 2d5c37af59e30fb0f875ba099214983a5469753d
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Jun 15 09:56:35 2010 +0100

    libtracker-miner: Added some comments to the content guessing code()
    
    - Added information about WHERE we got the code from - GIO
    - Added reasoning for why we have the is_multimedia check

 src/libtracker-miner/tracker-storage.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-storage.c b/src/libtracker-miner/tracker-storage.c
index 31f9eaa..9fde62e 100644
--- a/src/libtracker-miner/tracker-storage.c
+++ b/src/libtracker-miner/tracker-storage.c
@@ -398,6 +398,17 @@ mount_guess_content_type (GFile    *mount_root,
 			         device_path);
 		}
 
+		/* NOTE: This code was taken from guess_mount_type()
+		 * in GIO's gunixmounts.c and adapted purely for
+		 * guessing optical media. We don't use the guessing
+		 * code for other types such as MEMSTICKS, ZIPs,
+		 * IPODs, etc.
+		 *
+		 * This code may need updating over time since it is
+		 * very situational depending on how distributions
+		 * mount their devices and how devices are named in
+		 * /dev.
+		 */
 		if (strcmp (filesystem_type, "udf") == 0 ||
 		    strcmp (filesystem_type, "iso9660") == 0 ||
 		    strcmp (filesystem_type, "cd9660") == 0 ||
@@ -435,7 +446,13 @@ mount_guess_content_type (GFile    *mount_root,
 		g_free (mount_path);
 	}
 
-	/* Check we don't have multimedia */
+	/* We try to determine the content type because we don't want
+	 * to store Volume information in Tracker about DVDs and media
+	 * which has no real data for us to mine.
+	 *
+	 * Generally, if is_multimedia is TRUE then we end up ignoring
+	 * the media.
+	 */
 	guess_type = g_content_type_guess_for_tree (mount_root);
 
 	for (i = 0; guess_type && guess_type[i]; i++) {



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