[tracker/tracker-0.8] libtracker-miner: properly detect removable media
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] libtracker-miner: properly detect removable media
- Date: Thu, 17 Jun 2010 15:38:29 +0000 (UTC)
commit 9a2bade730d11c6fdd1ae3557222be9a5fea9d22
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue Jun 8 22:02:44 2010 +0200
libtracker-miner: properly detect removable media
src/libtracker-miner/tracker-storage.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-storage.c b/src/libtracker-miner/tracker-storage.c
index 47c215d..a7f597f 100644
--- a/src/libtracker-miner/tracker-storage.c
+++ b/src/libtracker-miner/tracker-storage.c
@@ -480,8 +480,19 @@ mount_add (TrackerStorage *storage,
} else {
/* Any other removable media will have UUID in the GVolume.
* Note that this also may include some partitions in the machine
- * which have GVolumes associated to the GMounts */
- is_removable = TRUE;
+ * which have GVolumes associated to the GMounts. So, we need to
+ * explicitly check if the drive is media-removable (machine
+ * partitions won't be media-removable) */
+ GDrive *drive;
+
+ drive = g_volume_get_drive (volume);
+ if (drive) {
+ is_removable = g_drive_is_media_removable (drive);
+ g_object_unref (drive);
+ } else {
+ /* Note: not sure when this can happen... */
+ is_removable = TRUE;
+ }
}
g_object_unref (volume);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]