[tracker/mounts-without-volumes: 4/23] libtracker-miner: properly detect removable media
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/mounts-without-volumes: 4/23] libtracker-miner: properly detect removable media
- Date: Tue, 15 Jun 2010 08:57:42 +0000 (UTC)
commit 80c497f34a5db57f5fb066e765316a269ea1b5be
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]