[tracker/rss-enclosures] Fixes GB#622351: Wrong initial detection of mounted state of the root partition



commit 85e88c2178a8a294133427f0c35ee222a97eea8e
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Jun 22 09:11:00 2010 +0200

    Fixes GB#622351: Wrong initial detection of mounted state of the root partition

 src/miners/fs/tracker-miner-files.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 3504886..c19c18a 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -761,19 +761,29 @@ query_mount_points_cb (GObject      *source,
 	                                 (GDestroyNotify) g_free,
 	                                 NULL);
 
+	/* Make sure the root partition is always set to mounted, as GIO won't
+	 * report it as a proper mount */
+	g_hash_table_insert (volumes,
+	                     g_strdup (TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN),
+	                     GINT_TO_POINTER (VOLUME_MOUNTED));
+
+	/* Get mounted status from store */
 	for (i = 0; i < query_results->len; i++) {
 		gchar **row;
-		gint state;
 
 		row = g_ptr_array_index (query_results, i);
-		state = VOLUME_MOUNTED_IN_STORE;
 
 		if (strcmp (row[0], TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN) == 0) {
-			/* Report non-removable media to be mounted by HAL as well */
-			state |= VOLUME_MOUNTED;
+			/* Update root partition to set also mounted in store */
+			g_hash_table_replace (volumes,
+			                     g_strdup (TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN),
+			                     GINT_TO_POINTER (VOLUME_MOUNTED | VOLUME_MOUNTED_IN_STORE));
+		} else {
+			/* Set status of known volumes in store */
+			g_hash_table_insert (volumes,
+			                     g_strdup (row[0]),
+			                     GINT_TO_POINTER (VOLUME_MOUNTED_IN_STORE));
 		}
-
-		g_hash_table_insert (volumes, g_strdup (row[0]), GINT_TO_POINTER (state));
 	}
 
 	/* Then, get all currently mounted non-REMOVABLE volumes, according to GIO */
@@ -792,10 +802,6 @@ query_mount_points_cb (GObject      *source,
 		g_hash_table_replace (volumes, non_removable_device_urn, GINT_TO_POINTER (state));
 	}
 
-	/* Make sure the root partition is always set to mounted */
-	g_hash_table_replace (volumes, g_strdup (TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN),
-	                      GINT_TO_POINTER (VOLUME_MOUNTED));
-
 	/* Then, get all currently mounted REMOVABLE volumes, according to GIO */
 	uuids = tracker_storage_get_device_uuids (priv->storage, TRACKER_STORAGE_REMOVABLE, FALSE);
 	for (u = uuids; u; u = u->next) {



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